apache日志文件怎么删除

来自:互联网
时间:2020-11-07
阅读:

今天无意中发现Apache下的apache_access.log和error.log文件已经达到3G左右了,遂决定清除该文件。

Windows下删除apache_access.log和error.log文件

1、删除C:\wamp\logs目录下的apache_access.log和access.log文件

2、打开Apache的httpd.conf配置文件并找到下面两条配置

ErrorLog "c:/wamp/logs/apache_error.log
"CustomLog "c:/wamp/logs/access.log" common

修改为

#ErrorLog "c:/wamp/logs/apache_error.log"
#限制错误日志文件为 1M
ErrorLog "|bin/rotatelogs.exe -l c:/wamp/logs/apache_error-%Y-%m-%d.log 1M"
#每天生成一个错误日志文件
ErrorLog "|bin/rotatelogs.exe -l c:/wamp/logs/apache_error-%Y-%m-%d.log 86400"
#CustomLog "c:/wamp/logs/access.log" common
CustomLog "|bin/rotatelogs.exe -l c:/wamp/logs/access-%Y-%m-%d.log 1M" common
CustomLog "|bin/rotatelogs.exe -l c:/wamp/logs/access-%Y-%m-%d.log 86400" common

apache日志文件怎么删除

返回顶部
顶部