logrotate charm should offer an opinionated option for rotating Juju logs

Bug #1955751 reported by Paul Goins
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
logrotate-charm
New
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.d/juju file which could be used for providing log rotation to files in the /var/lib/juju/ directory as a mitigation for this issue.

Related branches

Revision history for this message
Paul Goins (vultaire) wrote :

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.

Revision history for this message
Paul Goins (vultaire) wrote :

A slightly more nuanced solution has been proposed in this MR: https://code.launchpad.net/~vultaire/charm-logrotated/+git/charm-logrotated/+merge/413532

Revision history for this message
Eric Chen (eric-chen) wrote :

I think the logrotation rule should be managed by the application itself, not by charm-logrotated. I prefer to mark it as invalid.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.