[Rspamd-Users] syslog and missing log messages

Michael Grimm trashcan at ellael.org
Fri Apr 12 10:19:19 UTC 2024


Gerald Galster <list+rspamd at gcore.biz> wrote:

>> 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 :-)

I do follow your analysis, and do have the feeling, that this isn't a feature ;-)

And, I do not understand that LOG_DEBUG is part of levels_match[] although syslog_level is set to LOG_DEBUG as default, before looking for a different syslog level in levels_match[]? 

It seems to me that G_LOG_LEVEL_MESSAGE should replace G_LOG_LEVEL_DEBUG in levels_match[]. Most probably G_LOG_LEVEL_MESSAGE should match LOG_INFO, because I cannot find a single LOG_NOTICE or LOG_MESSAGE reference in the source code.

Regards,
Michael



More information about the Users mailing list