Rsyslog is not discarding message as it should

logsrsyslogsyslog

I have set up rsyslog to write messages from local0.* to a separate logfile, and then discard the messages. For some reason, the logs are going to both /var/log/syslog, and the new logfile.

I have put the config in rsyslog.d/30-local0.conf, which as far as I know, should come before the 50-default.conf, and so the message should be discarded before hitting the standard rules and being written to syslog?

Best Answer

Sounds correct so far, we may need more data (your actual config files).

Just to be sure, you should have this in 30-local0.conf:

local0.* /var/log/local0.log
       & ~
Related Question