This role enables log rotation for log files. Rotation occurs daily, and the files are compressed using the XZ compression.
Name | Required | Example | Description |
---|---|---|---|
name |
yes | tomcat |
Nickname of the log rotation configuration. |
pattern |
yes | /var/log/foo.log |
Pattern(s) for the file(s) to rotate. You can specify multiple patterns, one line per pattern, see examples for syntax. |
retention |
no | 14 |
Number of days to keep the rotated log files. Defaults to 7. |
- include_role:
name: noobient.logrotate
vars:
name: kf2-ddos
pattern: /var/log/kf2-ddos.log
- include_role:
name: noobient.logrotate
vars:
name: tomcat
pattern: |-
/opt/tomcat/logs/*.log
/opt/tomcat/logs/catalina.out
retention: 14
N/A
Platform | Support | Status |
---|---|---|
Linter | ✅ | |
AlmaLinux 8 | ✅ | |
AlmaLinux 9 | ✅ | |
Fedora 40 | ✅ | |
Fedora 41 | ✅ | |
Ubuntu 20.04 | ✅ | |
Ubuntu 22.04 | ✅ | |
Ubuntu 24.04 | ✅ |