Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

up vote 1 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
add comment

Your Answer

 
discard

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.