在httpd.conf配置文件中做如下修改: 1、将CustomLog logs/access_log combined改成 A:按天生成1og文件
CustomLog "|/usr/sbin/rotatelogs /var/log/httpd/%m_%d.access_log 86400 480" combined
B:按文件大小生成log文件(即30M)
CustomLog "|/usr/sbin/rotatelogs /var/log/httpd/access_log.%Y%m%d%H 30M" combined
2、将ErrorLog logs/error_log改成 A:按天生成error_log文件
ErrorLog "|/usr/sbin/rotatelogs /var/log/httpd/%m_%d.error_log 86400 480"
B:按文件大小生成log文件(即30M)
ErrorLog "|/usr/sbin/rotatelogs /var/log/httpd/error_log.%Y%m%d%H 30M"
路径注意不要错了
本文链接:https://www.it72.com/9532.htm