Home > Operation and Maintenance > Apache > How to delete apache log files

How to delete apache log files

王林
Release: 2020-11-06 16:44:27
forward
3873 people have browsed it

How to delete apache log files

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
Copy after login

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"
Copy after login
#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
Copy after login

How to delete apache log files

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template