今天無意中發現Apache下的apache_access.log和error.log檔案已經達到3G左右了,遂決定清除該檔案。
(學習影片推薦:java影片教學)
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
#以上是apache日誌檔怎麼刪除的詳細內容。更多資訊請關注PHP中文網其他相關文章!