L
Logrotate
Standard Linux log file management utility for rotation, compression, and cleanup.
No reviews yet
About Logrotate
Logrotate is a system utility included with virtually every Linux distribution that manages the automatic rotation, compression, and removal of log files. Without log rotation, server log files grow indefinitely until they consume all available disk space, which is one of the most common causes of server failures in hosting environments.
The tool runs daily via cron and processes log files according to configurable rules. Typical operations include: rotating logs when they reach a certain size or age, compressing rotated logs with gzip or bzip2, keeping a specified number of rotated logs before deleting the oldest, and executing scripts before or after rotation (such as restarting a service to release file handles).
On hosting servers, logrotate manages logs for every major service: Apache/Nginx access and error logs, PHP-FPM logs, MySQL slow query logs, Postfix/Exim mail logs, Dovecot logs, FTP logs, and system logs. cPanel configures logrotate automatically for all its managed services, but custom applications and services may need manual configuration.
The per-user log rotation on shared hosting is particularly important. Without it, a single customer's site generating excessive errors can fill the server's disk space with log data. cPanel's log processing handles per-domain log rotation and optional statistics generation (feeding AWStats or Webalizer) before archiving.
Logrotate configuration is straightforward. Each configuration block specifies the log file path, rotation frequency (daily, weekly, monthly), number of rotations to keep, compression settings, and optional pre/post-rotation scripts. Configurations are typically stored in /etc/logrotate.d/ with one file per service.
For hosting providers, properly configured logrotate is a basic operational necessity. Disk space exhaustion from unmanaged logs is entirely preventable and is one of the most embarrassing causes of customer-impacting outages. Regular audits of logrotate configuration ensure no service is generating logs outside the rotation system.
The tool runs daily via cron and processes log files according to configurable rules. Typical operations include: rotating logs when they reach a certain size or age, compressing rotated logs with gzip or bzip2, keeping a specified number of rotated logs before deleting the oldest, and executing scripts before or after rotation (such as restarting a service to release file handles).
On hosting servers, logrotate manages logs for every major service: Apache/Nginx access and error logs, PHP-FPM logs, MySQL slow query logs, Postfix/Exim mail logs, Dovecot logs, FTP logs, and system logs. cPanel configures logrotate automatically for all its managed services, but custom applications and services may need manual configuration.
The per-user log rotation on shared hosting is particularly important. Without it, a single customer's site generating excessive errors can fill the server's disk space with log data. cPanel's log processing handles per-domain log rotation and optional statistics generation (feeding AWStats or Webalizer) before archiving.
Logrotate configuration is straightforward. Each configuration block specifies the log file path, rotation frequency (daily, weekly, monthly), number of rotations to keep, compression settings, and optional pre/post-rotation scripts. Configurations are typically stored in /etc/logrotate.d/ with one file per service.
For hosting providers, properly configured logrotate is a basic operational necessity. Disk space exhaustion from unmanaged logs is entirely preventable and is one of the most embarrassing causes of customer-impacting outages. Regular audits of logrotate configuration ensure no service is generating logs outside the rotation system.
Server Software
Monitoring
Quick Facts
- Pricing
- Open Source
- License
- Open Source
- Platform
- Linux
- Version
- 3.22
- Developer
- Red Hat / Logrotate Contributors
- Starting Price
- $0.00
No reviews yet
Be the first to share your experience!
Discussion (0)
No comments yet
Start a discussion about this tool.