Apache日志文件每日自动切割的配置方法

2022-12-23 17:55:25 浏览数 (1)

打开Apache的httpd.conf文件,分别找到:

错误日志 ErrorLog logs/error_log 修改为 ErrorLog “| /usr/local/apache/bin/rotatelogs /usr/local/apache/logs/error_log_%Y%m%d 86400 480”

访问日志 CustomLog logs/access_log common 修改为 CustomLog “| /usr/local/apache/bin/rotatelogs /usr/local/apache/logs/access_log_%Y%m%d 86400 480” common

0 人点赞