mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-03 09:34:33 +02:00
refactor: logrotate
setup + rspamd log path + tests log helper fallback path (#3576)
* simplify `_setup_logrotate` * adjust Rspamd's log file and improve it's management * add information to docs about Rspamd log * update log query helper to allow another file location * bail in case `LOGROTATE_INTERVAL` is invalid --------- Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
This commit is contained in:
parent
82c38f2426
commit
894978ddd7
5 changed files with 40 additions and 27 deletions
|
@ -7,6 +7,7 @@ function _setup_rspamd() {
|
|||
__rspamd__log 'trace' '---------- Setup started ----------'
|
||||
|
||||
__rspamd__run_early_setup_and_checks # must run first
|
||||
__rspamd__setup_logfile
|
||||
__rspamd__setup_redis
|
||||
__rspamd__setup_postfix
|
||||
__rspamd__setup_clamav
|
||||
|
@ -101,6 +102,20 @@ function __rspamd__run_early_setup_and_checks() {
|
|||
fi
|
||||
}
|
||||
|
||||
# Keep in sync with `target/scripts/startup/setup.d/log.sh:_setup_logrotate()`
|
||||
function __rspamd__setup_logfile() {
|
||||
cat >/etc/logrotate.d/rspamd << EOF
|
||||
/var/log/mail/rspamd.log
|
||||
{
|
||||
compress
|
||||
copytruncate
|
||||
delaycompress
|
||||
rotate 4
|
||||
${LOGROTATE_INTERVAL}
|
||||
}
|
||||
EOF
|
||||
}
|
||||
|
||||
# Sets up Redis. In case the user does not use a dedicated Redis instance, we
|
||||
# supply a configuration for our local Redis instance which is started later.
|
||||
function __rspamd__setup_redis() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue