Turn off Apache error.log log generation and log generation by date

Source: Internet
Author: User
Tags log log socket

LogLevel used to adjust the level of detail in the information that is recorded in the error log

Level Description Example
Emerg emergency-System not available. "Child cannot open lock file. Exiting "
Alert must take immediate action. "Getpwuid:couldn ' t determine user name from UID"
Crit fatal condition. "Socket:failed to get a socket, exiting child"
Error condition. "Premature end of script headers"
Warn warning condition. "Child process 1234 did not exit, sending another Sighup"
Notice general important situation. "Httpd:caught Sigbus, attempting to dump core in ..."
Info General information. "Server seems busy, (you may need to increase startservers, or min/maxspareservers) ..."
Debug error level Information "Opening Config file ..."


It is generally recommended that you use Crit to warn settings


Edit the httpd.conf under the Conf folder and find the following:

=====================

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

=====================
LogLevel parameters can be seen above. (see errorlog directives).

The default level is warn, then logs above warn level will be logged, resulting in a large number of Erro-level error logs that "file does not exist". It is recommended that you use the Crit level setting to record only the logs above the fatal level, effectively reducing the number of logs.

Change the loglevel warn to loglevel crit and restart Apache.

By changing the errorlog parameter in the httpd.conf configuration file to the following, you can generate a log file on a daily basis.

  code is as follows copy code

ErrorLog "| Bin/rotatelogs.exe-l logs/error-%y-%m-%d.log 1M "
ErrorLog" |bin/rotatelogs.exe-l logs/error-%y-%m-%d.log 86400 " /p>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.