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.