Skip to content

Commit

Permalink
Fix #158: Add copytruncate to logrotate.conf.
Browse files Browse the repository at this point in the history
From lograte man pages:

> `copytruncate`: Truncate the original log file to zero size in place after creating a copy, instead of moving the old log file and optionally creating a new one.

Why? Because file might be followed by file descriptior (and not name).
So when logrorate rotates the file, Prometheus will follow the old file
(thus receiving no metrics).

By using `comytruncate` we ensure that the followed file is always the
proper one.
  • Loading branch information
bokysan committed Dec 29, 2023
1 parent 4b45249 commit 72988dd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions helm/mail/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ metrics:
enabled: true
logrotate.conf: |
/var/log/mail.log {
copytruncate
rotate 1
monthly
minsize 1M
Expand Down

0 comments on commit 72988dd

Please sign in to comment.