Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I noticed my error_log file grows larger and larger.

I tried changing the LogLevel in httpd.conf from

LogLevel debug


LogLevel emerg

But I still see errors being posted about favicon.ico not being found and so on.

If I delete error_log, I would have to restart apache, which causes some downtime for current viewers.

  • Is there a way to tell apache NOT to write any error_log?
  • OR is there a way to ensure it does not grow beyond 1 mb ( when it is not turned off )?

I notice access_logs are being "archived", but I rather want them also not to be created at all.

Do these archived access_logs ever get deleted or do I have to delete them myself?

share|improve this question

You can use logrotate, which allows you to rotate the logs (based on the date, the size...) and to choose how many files you want to keep. For instance, here's my config file for apache:

/var/log/apache2/*.log {
        rotate 52
        create 640 root adm
                if /etc/init.d/apache2 status > /dev/null ; then \
                    /etc/init.d/apache2 reload > /dev/null; \
share|improve this answer

You can use a utility such as cronolog to manage the web server log files. Using cronolog, log files can be automatically rotated without having to shut down and restart the web server.


cronolog is a simple filter program that reads log file entries from standard input and writes each entry to the output file specified by a filename template and the current date and time. When the expanded filename changes, the current file is closed and a new one opened. cronolog is intended to be used in conjunction with a Web server, such as Apache, to split the access log into daily or monthly logs.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.