You've already forked docker-mailserver
mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-08 23:06:49 +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:
@ -429,8 +429,11 @@ function _filter_service_log() {
|
||||
local SERVICE=${1:?Service name must be provided}
|
||||
local STRING=${2:?String to match must be provided}
|
||||
local CONTAINER_NAME=$(__handle_container_name "${3:-}")
|
||||
local FILE="/var/log/supervisor/${SERVICE}.log"
|
||||
|
||||
_run_in_container grep -E "${STRING}" "/var/log/supervisor/${SERVICE}.log"
|
||||
# Fallback to alternative log location:
|
||||
[[ -f ${FILE} ]] || FILE="/var/log/mail/${SERVICE}.log"
|
||||
_run_in_container grep -E "${STRING}" "${FILE}"
|
||||
}
|
||||
|
||||
# Like `_filter_service_log` but asserts that the string was found.
|
||||
|
Reference in New Issue
Block a user