Skip to content

LOGROTATE_SIZE is mutually exclusive with LOGROTATE_INTERVAL, and there is no way to set maxsize. #50

@adambuchbinder

Description

@adambuchbinder

Setting LOGROTATE_SIZE and LOGROTATE_INTERVAL produces output like the following in /usr/bin/logrotate.d/logrotate.conf (in the container):

# deactivate mail
nomail

# move the log files to another directory?

/var/log/foo.log {
 su root root
 rotate 7
 missingok
 nocompress
 copytruncate
 daily
 size 1G
}

But in practice, it seems that size replaces daily in that the logs are not rotated, at least if their size is under 1G. (See this StackOverflow answer.) I want the logs to rotate if the size exceeds a threshold or a day has passed, i.e., keep up to 7 extra logs of size no more than 1G each, rotating daily even if the size hasn't been met.

I think I need to be able to set maxsize for this to work. Also, there should be a warning about setting both LOGROTATE_SIZE and LOGROTATE_INTERVAL, as it doesn't do what's expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions