停止进入/ var / log / debug的消息

我有一个守护进程运行,milter-regex绝对污染我的/ var / log / debug文件。 经过一番挖掘,我想通过添加“daemon.err; daemon.notice / var / log / milter-regex”来阻止milter-regex的东西进入/ var / log / debug。 但是这没有用。 我错过了什么?

我的/etc/rsyslog.d/50-default.conf文件:

# # Some "catch-all" log files. # *.=debug;\ auth,authpriv.none;\ news.none;mail.none -/var/log/debug *.=info;*.=notice;*.=warn;\ auth,authpriv.none;\ cron,daemon.none;\ mail,news.none -/var/log/messages daemon.err;daemon.notice /var/log/milter-regex # # NOTE: adjust the list below, or you'll go crazy if you have a reasonably # busy site.. # daemon.*;mail.*;\ news.err;\ *.=notice;*.=warn |/dev/xconsole 

为了安全起见,添加daemon.none以避免守护进程消息进行debugging

 *.=debug;\ auth,authpriv.none;\ news.none;mail.none;\ daemon.none -/var/log/debug 

这也会阻止任何其他守护进程消息到达您的debugging日志。

另外我不认为你想把所有daemon.errdaemon.notice发送到一个milter-regex显式文件。

如果我是你的话,我会试着看看milter-regex来通过mail.*发送mail.* (它跟邮件有关)或者把自己写入日志文件