logrotate charm should offer an opinionated option for rotating Juju logs
Bug #1955751 reported by
Paul Goins
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
logrotate-charm |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Log rotation in juju appears to be handled internally at present. However, on Juju units with smaller disks, the automatic rotation at 300MB may be too large a threshold to effectively keep logs under control.
While I've filed lp1955750 against Juju regarding the above, we may also want to consider providing our own /etc/logrotate.
Related branches
~xavpaice/charm-logrotated:lp1955751
Rejected
for merging
into
charm-logrotated:master
- Xav Paice (community): Needs Fixing
- 🤖 prod-jenkaas-bootstack (community): Needs Fixing (continuous-integration)
- BootStack Reviewers: Pending (mr tracking; do not claim) requested
- BootStack Reviewers: Pending requested
- BootStack Reviewers: Pending requested
- Canonical IS Reviewers: Pending requested
-
Diff: 77 lines (+50/-1)2 files modifiedsrc/config.yaml (+10/-0)
src/reactive/logrotate.py (+40/-1)
~vultaire/charm-logrotated:lp1955751
Superseded
for merging
into
charm-logrotated:master
- 🤖 prod-jenkaas-bootstack (community): Needs Fixing (continuous-integration)
- Canonical IS Reviewers: Pending requested
- BootStack Reviewers: Pending requested
- BootStack Reviewers: Pending requested
-
Diff: 77 lines (+50/-1)2 files modifiedsrc/config.yaml (+10/-0)
src/reactive/logrotate.py (+40/-1)
To post a comment you must log in.
It appears that Juju does the right thing in conjunction with logrotated. While Juju appears to keep file handles to the log files open, If I manually trigger a log rotation, Juju does appear to respect logrotated's signals and start logging to the new log files.
Thus, addressing this may be as simple as optionally installing the following as /etc/logrotate. d/juju:
/var/log/juju/*.log
{
missingok
daily
copytruncate
rotate 7
notifempty
}
The above would of course be adjusted appropriately by the charm per normal operation.