#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