General Information
Checklist
Forcing a log rotation can be useful after implementing a new rotation file (in /etc/logrotate.d) or to test after making changes.
/usr/sbin/logrotate -f /etc/logrotate.d/myapp
/usr/sbin/logrotate -f /etc/logrotate.conf
/etc/logrotate.conf is left alone in its default installed state.
Ensure that /etc/logrotate.d is included (it is by default):
include /etc/logrotate.d
All additional log configuration files go in: /etc/logrotate.d/
Example Log Config
## Application Logs ## /opt/myapp/logs/logs.txt { #Rotate monthly monthly #Keep 12 old log files, delete older rotate 12 #Copy current log to rotated, then truncate in place copytruncate #Give rotated log file a date extension YYYYMMDD dateext #Compress old log files with gzip compress }