Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 need an alternate for rotating logs on my server, everytime logrotate runs apache goes down for like 10-20 minutes, i'm not sure if this is right, but don't seem right for me.

Is there any alternate for logrotate on apache? That long time to rotate logs is unusual?

My setup is fedora core 9, apache 2.2.14


share|improve this question
10-20 minutes is definitely unusual. The normal practice is to configure logrotate so that when it runs, it signals Apache to do a graceful restart (i.e. reload its configuration and log file handles without actually shutting down). So you should have no downtime at all due to log rotations. – David Z Jul 11 '10 at 23:29
up vote 5 down vote accepted

I like cronolog. Apache can pipe the output to cronolog which stores things in logs based on whatever template you use.

On my server where I use these two directives in the global scope only one copy of cronolog started and used for writing logs. This will create a new log file for each year+month.

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combinedvhost
CustomLog "|/usr/bin/cronolog /var/log/apache2/%Y%m.combined.allhosts.log" combinedvhost
share|improve this answer
Thanks that's what i was looking for, no need to restart apache in order to rotate logs. – Rodrigo Jul 12 '10 at 3:25

everytime logrotate runs apache goes down for like 10-20 minutes, i'm not sure if this is right, but don't seem right for me

No - sounds like your system is broken - I'd be tempted to fix it rather than trying something else - logrotate is a very useful tool used properly.

What does your current logrotate script(s) look like?


share|improve this answer

If you restart Apache manually, does it also take 10-20 minutes?

If it's taking that long to rotate logs, it seems like Apache is getting stuck somewhere which would happen manually too or logrotate is running into disk issues when trying to move the logs.

Is the compress option on? If it is, what happens when you turn it off?

share|improve this answer

I would look into the options passed to logrotate.

In my experience you should use copytruncate (log files are copied first, then truncated).

This also negates the need to restart apache after logrotate has finished.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.