refactor: logrotate setup + rspamd log path + tests log helper fallback path#3576
refactor: logrotate setup + rspamd log path + tests log helper fallback path#3576georglauterbach merged 8 commits intomasterfrom
logrotate setup + rspamd log path + tests log helper fallback path#3576Conversation
|
Instead of
|
Done :D |
lessmost
|
Just a general thought: Is there a specific reason to put the rspamd.log inside the container instead of the central (usually volumed) logging directory in I'm currently using the following patches to add logrotate + change the path: /etc/rspamd/local.d/logging.inc /etc/logrotate.d/rspamd |
I imagine it's just been that way since supervisor was introduced. There has been talk about refactoring how we manage logging, where Vector may be suitable. Ideally each service will keep it's logs separate and Vector would support configuration to output a log that combines those streams at whatever log level desired. It wouldn't be fixed to |
|
Yeah, that sounds good. My reasoning for the comment was somewhat along the lines of: If you write to If I look at the file sizes of the files in For me it's just a bit odd that we use a somewhat centralized logging directory + logrotate for many things mail-related, but not here. But this is also the wrong ticket to discuss this anyway, so this is just a +1 for centralized logging. |
|
I'll come up with an update tomorrow |
fcfeaf8
0fe347e to
fcfeaf8
Compare
most|
I adjusted the PR so that the changes proposed by @reneploetz are incorporated. I will provide another PR that introduces updates to debug-packages later to have this PR only care about Rspamd and its logs. The Rspamd logs are now managed by logrotate as well. Until Vector is used, I think this is the best way to move forward. |
|
Thanks for the updated pull request! |
fcfeaf8 to
c1bab80
Compare
c1bab80 to
1bd695d
Compare
| cat >/etc/logrotate.d/maillog << EOF | ||
| /var/log/mail/mail.log | ||
| { | ||
| compress | ||
| copytruncate | ||
| delaycompress | ||
| rotate 4 | ||
| ${LOGROTATE_INTERVAL} | ||
| } | ||
| EOF |
There was a problem hiding this comment.
No action required
This is much more readable than the previous approach with the split { + } that looked almost like a typo 🚀
Regarding rotate 4, I guess that makes sense for weekly, while a bit odd for daily and monthly. I'm assuming git blame would show this was introduced with weekly in mind.
Given you've dropped the switch statement and no one seems to be bothered I guess leaving it at 4 here is fine, I was just a little curious what that setting did when I saw it here.
There was a problem hiding this comment.
I stumbled upon the same while reviewing. We could introduce $LOGROTATE_COUNT or (not so readable) $LOGROTATE_ROTATE to make the rotation count configurable.
There was a problem hiding this comment.
It should be ok, no need to add new ENV to support this until we get actual requests to adjust the default.
logrotate setup + rspamd log path + tests log helper fallback path
|
Documentation preview for this PR is ready! 🎉 Built with commit: 011b298 |
Description
In order to allow users to more easily go through log files, I addedmostto the set of packages we install. This adds +122kB in size, which I think is negligible.Moreover, I added a section to the Rspamd documentation about where to find the corresponding log files.I adjusted this PR to only include changes to logrotate and to the Rspamd log. In detail, I improved
_setup_logrotateby simplifying it and making it more readable. Moreover, I adjusted the Rspamd log file location and added a logrotate config for the Rspamd log file.I will provide a follow-up PR that includes changes about adding and removing packages, as discussed here.
Associated: #3570
Type of change
Checklist:
docs/)