分割apache日志 rotatelogs cronolog

方法一:

配置httpd.conf,找到CustomLog logs/access.log common,用#注解掉这行,在下面加入:

ErrorLog "|bin/rotatelogs.exe logs/error_%Y-%m-%d.log 86400 480"

CustomLog "|bin/rotatelogs.exe logs/access_%Y-%m-%d.log 86400 480" combined

86400表示1天,480是与UTC相差的时间,8×60=480分钟。

方法二:

http://cronolog.org/download/index.html 下载一个合适版本,我用的是 Win 32 version,

将cronolog.exe解压到 Apache的bin目录下,

配置httpd.conf

找到CustomLog logs/access.log common,用#注解掉这行,在下面加入:

CustomLog "|bin/cronolog.exe logs/access_%Y-%m-%d.log" combined

你可能感兴趣的:(apache,html,Access)