How to change Httpd. error. log off, the method is very simple, directly in httpd. in the conf configuration file, locate ErrorLog and add # To the front to restart apache. However, this will bring a lot of problems to your system analyst, for example, apache cannot analyze many error intrusions.
LogLevel is used to adjust the details of information recorded in error logs.
Level Description Example
Emerg emergency-the system is unavailable. "Child cannot open lock file. Exiting"
Alert must take immediate action. "Getpwuid: couldn't determine user name from uid"
Critical Condition of crit. "Socket: Failed to get a socket, exiting child"
Error. "Premature end of script headers"
Warn warning. "Child process 1234 did not exit, sending another SIGHUP"
Notice is generally important. "Httpd: caught SIGBUS, attempting to dump core in ..."
Info. "Server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers )..."
Debug error level information "Opening config file ..."
We recommend that you set crit to warn.
Edit httpd. conf In the conf folder and find the following content:
==================================
The Code is as follows: |
Copy code |
# # LogLevel: Control the number of messages logged to the error_log. # Possible values include: debug, info, notice, warn, error, crit, # Alert, emerg. # LogLevel warn
|
==================================
The LogLevel parameter can be viewed above. (See ErrorLog command ).
If the default level is warn, logs at or above the warn level will be recorded, resulting in a large number of erro-level error logs that "the file does not exist. We recommend that you use the crit-level settings to record logs with more than the fatal level, effectively reducing the number of logs.
Change LogLevel warn to LogLevel crit and restart apache.
Change the ErrorLog parameter in the Httpd. conf configuration file to the following to generate a log file every day.
The Code is as follows: |
Copy code |
ErrorLog "| bin/rotatelogs.exe-l logs/error-% Y-% m-% d. log 1 M" ErrorLog "| bin/rotatelogs.exe-l logs/error-% Y-% m-% d. log 86400" |