How can I get Haproxy to not log local requests?

Posted by coneybeare on Server Fault See other posts from Server Fault or by coneybeare
Published on 2011-02-15T02:19:06Z Indexed on 2011/02/15 15:27 UTC
Read the original article Hit count: 258

Filed under:
|
|
|
|

I am trying to clean out some of the log clutter from my machines and am starting by removing requests that are generated from the server themselves. I have cache warmers running around the clock and I don't want these polluting the logs.

I was able to get apache to stop logging local requests by adding a dontlog for the local IP:

SetEnvIf Remote_Addr "RE\.DA\.CT\.ED" dontlog
CustomLog "|logger -p local3.info -t http" combined env=!dontlog

and now I am looking for something similar to put in a configuration for the Haproxy log. How can I prevent 127.0.0.1 requests from writing to the Haproxy log?




UPDATE: 2/15/11

I use the excellent loggly service to pull out logs in the cloud, but I am seeing tons of logs like this:

2011 Feb 15 06:09:42.000 ip-10-251-194-96 http: RE.DA.CT.ED - - [15/Feb/2011:06:09:42 -0500] "HEAD /search/Nevad/predictive/txt HTTP/1.0" 200 - "-" "Wget/1.10.2 (Red Hat modified)"
2011 Feb 15 06:09:42.000 127.0.0.1 haproxy[10390]: 127.0.0.1:58408 [15/Feb/2011:06:09:42] www i-5dd7a331.0 0/0/0/8/8 200 210 - - --NI 0/0/0 0/0 "HEAD /search/Nevad/predictive/txt HTTP/1.1"

and I want them gone. This question focuses on how to remove that haproxy log line from writing to the server side log in the first place.

© Server Fault or respective owner

Related posts about apache

Related posts about server