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.
}
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"