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