[Rspamd-Users] syslog and missing log messages

Gerald Galster list+rspamd at gcore.biz
Fri Apr 12 01:23:06 UTC 2024


> But there is one more puzzle remaining, namely why my local.d/loggin.inc …
> 
> 	type = "syslog";
> 	facility = "mail";
> 	level = "info";     # log all non-debug messages
> 
> … will send mail.*debug* messages to my host's syslog in the first place? 

local.d/logging.inc level "info" is not necessarily syslog level info.

src/libserver/logger.h:
    #define msg_notice(...) rspamd_default_log_function(G_LOG_LEVEL_MESSAGE,
    #define msg_info(...) rspamd_default_log_function(G_LOG_LEVEL_INFO

rspamd_task_write_log calls msg_notice_task and probably uses G_LOG_LEVEL_MESSAGE.


https://github.com/rspamd/rspamd/blob/master/src/libserver/logger/logger_syslog.c#L58-L82

Log levels G_LOG_LEVEL_DEBUG, _INFO, _WARNING, _ERR are mapped at line 66+.
G_LOG_LEVEL_MESSAGE is not part of levels_match[] (line 69+), so it should default
to syslog_level = LOG_DEBUG in line 82, which would explain why you see mail.*debug*
... or my quick code grep is bogus and it works totally different :-)

Best regards,
Gerald




More information about the Users mailing list