What we're saying here about Apache's log is the thing about the access log! To prevent log files from being too large, we archive the logs on a daily basis!
Vim/usr/local/apache2/conf/extra/httpd-vhosts.conf
Open the virtual machine configuration file and remove the # number in front of the following two lines
Errorlog "Logs/dummy-host2.example.com-error_log" Customlog "Logs/dummy-host2.example.com-access_log" common
Then restart the Apache service and visit some sites to see the generated log files:
[Email protected] logs]# Lsaccess_log error_logdummy-host2.example.com-access_log Httpd.piddumm Y-host2.example.com-error_log
Then start configuring the Cut log file as follows:
Errorlog "|/usr/local/apache2/bin/rotatelogs-l/usr/local/apache2/logs/test2.com-error_%y%m%d.log 86400" CustomLog "|/usr/local/apache2/bin/rotatelogs-l/usr/local/apache2/logs/test2.com-access_%y%m%d.log 86400" combined
Then look at the log file:
[Email protected] logs]#/usr/local/apache2/bin/apachectl-tsyntax ok[[email protected] logs]#/usr/local/apache2/bin /apachectl Restart[[email protected] logs]# lsaccess_log error_log httpd.pid test2.com-access_20151118.log
For more details on Apache logs, you can view this blog post!
This article is from the "Custom" blog, so be sure to keep this source http://zidingyi.blog.51cto.com/10735263/1714448
Apache Log Cutting