apache日志分割的方法

在httpd.conf中找到这两项


ErrorLog logs/error_log
CustomLog logs/access_log common

替换成
ErrorLog "| /usr/sbin/rotatelogs /var/log/httpd/%Y_%m_%d_error_log 86400 480"
CustomLog "| /usr/sbin/rotatelogs /var/log/httpd/%Y_%m_%d_access_log 86400 480" common

rotatelogs是apache的一个日志分割的一个软件,centos里路径是/usr/sbin里面,替换之前查找一下这个文件的路径 find / -name rotatelogs

 

posted @ 2013-09-24 09:13  nestfly  阅读(173)  评论(0编辑  收藏  举报