Apache Log Cutting

Source: Internet
Author: User
Tags apache log


[[email protected] ~]# vim/usr/local/apache2/conf/extra/httpd-vhosts.conf (Save the following # two files)

Errorlog "Logs/dummy-host.example.com-error_log"

Customlog "Logs/dummy-host.example.com-access_log" combined


Common Primary log file

[Email protected] ~]# vim/usr/local/apache2/conf/httpd.conf

[Email protected] ~]# ls/usr/local/apache2/logs/

Access_log Error_log Httpd.pid

[Email protected] ~]#/usr/local/apache2/bin/apachectl Graceful

[Email protected] ~]# cd/usr/local/apache2/logs/

[[email protected] logs]# ls

Access_log dummy-host.example.com-access_log Dummy-host.example.com-error_log error_log httpd.pid

[[email protected] logs]# cat dummy-host.example.com-access_log (View access log)


Log Cutting


[Email protected] ~]# vim/usr/local/apache2/conf/extra/httpd-vhosts.conf

Errorlog "Logs/test.com-error_log"

Customlog "|/usr/local/apache2/bin/rotatelogs-l/usr/local/apache2/logs/test.com-access_%y%m%d_log 86400" combined


Syntax OK

[Email protected] ~]#/usr/local/apache2/bin/apachectl restart

[[email protected] logs]# ls

Access_log Dummy-host.example.com-error_log httpd.pid Test.com-error_log

Dummy-host.example.com-access_log Error_log Test.com-access_20160315_log

[[email protected] logs]# date-s "2016-03-16 01:01:00"

Wednesday, March 16, 2016 01:01:00 CST

[[email protected] logs]# ls

Access_log Dummy-host.example.com-error_log httpd.pid test.com-access_2016031 6_log

Dummy-host.example.com-access_log error_log Test.com-access_20160315_log Test.com-error_log


This article is from the "Mr Guo" blog, so be sure to keep this source http://490617581.blog.51cto.com/7223113/1751102

Apache Log Cutting

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.