Is there any alternate to logrotate for apache logs?
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
Thanks.
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
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.
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?
C.
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?