2

I have a fairly standard postfix installation which is monitored using monit. Monit checks the connection every so often and when it does, the connection from localhost is somewhat polluting my log files.

Is there a way to change this logging behavior?

1
  • @masegaloeh, You just pointed out a "duplicate" that was asked 3 years after my post. Perhaps you should put the duplicate marking on the other post instead.
    – astjohn
    Jun 11, 2015 at 1:09

1 Answer 1

3

Not from Postfix, but if you use a new enough syslog daemon you can do it there. For example, in syslog-ng you can create a filter that matches the localhost connections and in your log statement do a conditional that excludes matches for that filter.

For example (off the top of my head check before using):

filter f_mailNoLocalhost { facility(mail) and not match("matching pattern here");};

That said, you'll probably need to know about them sooner or later and not having them will be a detriment. You could also just filter them out when running through whatever parser you are using to parse them - even if it's just your eyes. ;) Also if running a syslog daemon that doesn't have such capabilities you could set up a cron job to clean (via "grep -v pattern") after the log is rotated.

If the connection count is significant enough to be "polluting" the logs it is significant enough to keep since it may affect troubleshooting.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .