Apache Log Cutting

Source: Internet
Author: User
Tags apache log

#vim/usr/local/apache2/conf/extra/httpd-vhosts.conf
Open two lines of comments (Errorlog and Customlog), generate access and errors corresponding to the log, of course, you can also modify the default generated file name

Then change the last face of Customlog to combined, because I use the combined type

#apache1 Restart #重启一下apache服务

Go to refresh the Web page (generate log)

#ls/usr/local/apache2/logs/#到这里就可以看见生成的日志了

Below is the format of the cut:

vim/usr/local/apache2/conf/extra/httpd-vhosts.conf (Modify Customlog line below)

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

Explain:

Rotatelogs tool for cutting logs; 86400 is actually the time, the second unit, just one day, equivalent to a log a day; behind is the place where the log is stored and the name of the log.

#apachectl Restart Restart the service, refresh the Web page, and then go to the log store to see, you can see the generated day log.

This article is from the "11165660" blog, please be sure to keep this source http://11175660.blog.51cto.com/11165660/1764688

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.