CENTOS7, troubleshooting Apache error log file too big problem

Source: Internet
Author: User
Tags apache error log

1, log file is too big the first step: Stop all processes of Apache service, delete the Error.log, access.log files under the/var/log/httpd directory Step two: Open the/etc/httpd/conf httpd.conf configuration file and locate the following configuration Errorlog Logs/error.log put the above comment off and change it to # generate an error log file every day errorlog "|/usr/sbin/rotatelogs/var/log/httpd /error_log%y%m%d.log 86400 480 "or # Limit error log file to 1MErrorLog" |/usr/sbin/rotatelogs/var/log/httpd/error_log%y%m%d.log 1M " Locate the following configuration Customlog Logs/access.log combined the above comment off, change # to generate an access log file every day Customlog "|/usr/sbin/rotatelogs/var/log/httpd/ Access_log%y%m%d.log 86400 480 "Common or # Limit access log file to 1MCustomLog" |/usr/sbin/rotatelogs/var/log/httpd/access_log%y%m% D.log 1M "Common 2, in order to prevent frequent write some unimportant error log, improve system performance, it is best to set the error log level to find the httpd.conf configuration file# # Loglevel:control The number of messages logged to the Error_log.# Possible Values Include:debug, info, notice, warn, error, Crit,# Alert, Emerg.# LogLevel warnwhere loglevel is used to adjust the verbosity of the information that is recorded in the error log. (see errorlog Directive). The following levels can be selected, sorted in descending order of importance:Level Description ExampleEmerg 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 case. "Child process 1234 do not exit, sending another SIGHUP"Notice general important situation. "Httpd:caught Sigbus, attempting to dump core in ..."Info General information. "Server seems busy, (you could need to increase startservers, or min/maxspareservers) ..."Debug Error level Information "Opening config file ..."The default level is warn, so logs above the 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 so that only logs above the fatal level are logged, effectively reducing the number of logs. change the loglevel warn to loglevel crit and restart Apache.

CENTOS7, troubleshooting Apache error log file too big problem

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.