Today I accidentally discovered that the apache_access.log and error.log files under Apache have reached about 3G, so I decided to clear the files.
(Learning video recommendation: java video tutorial)
Delete apache_access.log and error.log files under windows
1. Delete C:\ apache_access.log and access.log files in the wamp\logs directory
2. Open Apache’s httpd.conf configuration file and find the following two configurations
ErrorLog "c:/wamp/logs/apache_error.log "CustomLog "c:/wamp/logs/access.log" common
and modify them to
#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
Related recommendations: apache
The above is the detailed content of How to delete apache log files. For more information, please follow other related articles on the PHP Chinese website!