CustomLog "|bin/rotatelogs /var/logs/logfile 1M" common
日志大小满1M,就生成新的日志文件记录。
其他一些配置:
SetEnvIf Request_URI "/.gif$" dontlog
SetEnvIf Request_URI "/.jpg$" dontlog
SetEnvIf Request_URI "/.css$" dontlog
CustomLog "|/usr/local/sbin/cronolog /data/www/logs/%Y/%m/%d/access.log" custom env=!dontlog
ErrorLog "|/usr/local/sbin/cronolog /data/www/logs/%Y/%m/%d/error.log"
CustionLog 表示自定义的配置
ErrorLog 表示错误日志的配置
参考文档:
http://httpd.apache.org/docs/2.2/logs.html#piped
http://httpd.apache.org/docs/2.2/programs/rotatelogs.html
http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/logs.html