Logrotate

Logrotate is Article description::a tool to periodically rotate (archive), delete, and optionally compress and/or mail historic log files. Logrotate ships with, and is invoked by a cron job.

Files
Accelerating log rotation can be very useful to setting up log rotate. Initial purging of extremely large logs, getting familiar with day to day messages, cleaning up the system, and setting up intrusion prevention systems can benefit greatly from this. Daily log rotation encourages administrators to be proactive about security, and system health rather than reactive.


 * - The daemon's configuration file.
 * - This directory contains all log rotate settings and directives.

If you choose a different rotation, remember to move the logrotate script in the correct subdirectory, eg. under /etc/cron.weekly for a weekly rotation of logs.

Portage log example
If the PORT_LOGDIR variable is set in build logs will need to be rotated. The first line of the configuration file should hold the path where logs are stored by Portage:

To regularly delete logs add the line  to the config file, where   is the number of days after which the log file will be deleted.