Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
@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 '15 at 1:09
up vote 2 down vote accepted

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.

share|improve this answer
Worked out well. Thanks! – astjohn Jun 1 '11 at 0:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.