-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
refactor: logrotate
setup + rspamd log path + tests log helper fallback path
#3576
Conversation
Instead of
|
Done :D |
less
most
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
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 addedmost
to 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_logrotate
by 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/
)