Apache Log Management – Alternatives to Logrotate for Apache Logs

apache-2.2log-fileslogrotate

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.

Best Answer

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