-
Notifications
You must be signed in to change notification settings - Fork 512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add logrotate config #6142
Add logrotate config #6142
Conversation
0f631f0
to
4b5b84e
Compare
In case users decide to store Mimir's logs out of journald (e.g. `/var/log/mimir.log`) we want to be sure that Mimir's logs won't fill up the disk. Tested on Debian 11, Centos 7 and AlmaLinux 8. ``` [root@centos7 ~]# logrotate --debug --verbose /etc/logrotate.d/mimir reading config file /etc/logrotate.d/mimir Allocating hash table for state file, size 15360 B Handling 1 logs rotating pattern: /var/log/mimir/mimir.log after 1 days (7 rotations) empty log files are not rotated, old logs are removed considering log /var/log/mimir/mimir.log ``` ``` [root@alma8 ~]# logrotate --debug --verbose /etc/logrotate.d/mimir WARNING: logrotate in debug mode does nothing except printing debug messages! Consider using verbose mode (-v) instead if this is not what you want. reading config file /etc/logrotate.d/mimir Reading state from file: /var/lib/logrotate/logrotate.status Allocating hash table for state file, size 64 entries Handling 1 logs rotating pattern: /var/log/mimir/mimir.log after 1 days (7 rotations) empty log files are not rotated, old logs are removed considering log /var/log/mimir/mimir.log Creating new state ``` ``` root@debian11:~# logrotate --debug --verbose /etc/logrotate.d/mimir WARNING: logrotate in debug mode does nothing except printing debug messages! Consider using verbose mode (-v) instead if this is not what you want. reading config file /etc/logrotate.d/mimir Reading state from file: /var/lib/logrotate/status Allocating hash table for state file, size 64 entries Creating new state Creating new state Creating new state Creating new state Creating new state [...] Handling 1 logs rotating pattern: /var/log/mimir/mimir.log after 1 days (7 rotations) empty log files are not rotated, old logs are removed considering log /var/log/mimir/mimir.log Creating new state ``` Signed-off-by: Ludovic Terrier <5823358+ldvc@users.noreply.github.com>
4b5b84e
to
6d5aa45
Compare
I'm 👍 if the packaging folks are good with this but I'm a little confused. Mimir doesn't even support writing to log files (only stderr). These log files would be something else running Mimir and writing the log files (like Supervisord or something)? |
By adding these two parameters in the systemd unit file, logs can be appended to a file:
We would not like to make these parameters enabled by default as:
As a side note, there is also a Puppet module in order to ease Mimir management. |
What this PR does
In case users decide to store Mimir's logs out of journald (e.g.
/var/log/mimir.log
), we want to be sure that Mimir's logs won't fill up the disk.Which issue(s) this PR fixes or relates to
N/A
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]