from https://help.ubuntu.com/community/LinuxLogFiles :
Typically, logrotate is called from
the system-wide cron script
/etc/cron.daily/logrotate, and further
defined by the configuration file
configuration files can be added into
/etc/logrotate.d (where the apache2
and mysql configurations are stored
The files involved are:
As with Matt, cron.daily jobs are started at 6:25am on my system, but actual execution time will vary depending on jobs in cron.daily, system load, etc..
/etc/cron.daily/logrotate runs logrotate using the logrotate.conf file:
/etc/logrotate.conf points to the /etc/logrotate.d directory:
/etc/logrotate.d contains individual scripts for specific log files
For these files, the actions in curly braces (rotate, compress, etc.) are performed on the files defined at the beginning of each block. Wildcards are allowed, so something like '/var/log/*log' should affect all files in /var/log/ that end with the .log suffix.
If prerotate is one of the keywords used in the block that belongs to '/var/log/*log', then those files will have the prerotate commands run on them, but "only if the log will actually be rotated."(from man logrotate)