Apache的access.log日志文件太大
点击:41
发布时间:
Apache中日志配置,在conf/httpd.conf。默认写法为:
CustomLog logs/access.log common
此写法导致日志文件一直变大。
如果我们不想要生成此日志,可以将此日志注释掉。写法为:
#CustomLog logs/access.log common
我们也可以使用其它方法:
限制日志文件大小:
CustomLog "|bin/rotatelogs.exe -l logs/access-%Y-%m-%d.log 1M" common
每天生成一个新的log文件:
CustomLog "|bin/rotatelogs.exe -l logs/access-%Y-%m-%d.log 86400" common