From: Vsevolod Stakhov Date: Fri, 29 May 2026 07:36:12 +0000 (+0100) Subject: [Conf] Make logging type and filename env-overridable X-Git-Tag: 4.1.0~16^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ccf7b96cf057b3a1cede61ce4f66916c3b3bbcbd;p=thirdparty%2Frspamd.git [Conf] Make logging type and filename env-overridable Template the baseline logging block so deployments can switch logging without patching conf/rspamd.conf: type = "{= env.LOG_TYPE|default('file') =}"; filename = "{= env.LOG_FILE|default('$LOGDIR/rspamd.log') =}"; With no RSPAMD_LOG_TYPE/RSPAMD_LOG_FILE set the values render to the previous hardcoded defaults (file, $LOGDIR/rspamd.log), so stock installs are unchanged. A container can now set RSPAMD_LOG_TYPE=console to log to stdout. Mirrors the env-template style introduced for the worker bind_socket lines. --- diff --git a/conf/rspamd.conf b/conf/rspamd.conf index aa2530b555..97bbdf5b41 100644 --- a/conf/rspamd.conf +++ b/conf/rspamd.conf @@ -31,8 +31,10 @@ lang_detection { } logging { - type = "file"; - filename = "$LOGDIR/rspamd.log"; + # Defaults to file logging; a deployment can export RSPAMD_LOG_TYPE + # (e.g. console or syslog) and RSPAMD_LOG_FILE to override without a patch. + type = "{= env.LOG_TYPE|default('file') =}"; + filename = "{= env.LOG_FILE|default('$LOGDIR/rspamd.log') =}"; .include "$CONFDIR/logging.inc" .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/logging.inc" .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/logging.inc"