Ignore heartbeat in Apache access logs

apache-2.2httpd.conflogging

We have that nice/awesome Fogbugz tools that is running on our production server.
The problem is that this server handles more than 400 domain names and more than 20 real websites.

The logs are already pretty heavy, and since we've installed Fogbugz, there's a very nice process called heartbeat that is called every 15 seconds!!
Just imagine the size of our logs now… polluted with tons of lines like:

GET /fogbugz/heartbeat.asp HTTP/1.1" 302 223 "-" "FogBugz Maintenance Service 7.1"

(see http://fogbugz.stackexchange.com/questions/794/what-does-the-fogbugz-maintenance-service-actually-do)

We're running the latest Apache httpd server version. Is there any way to ignore just this specific request, and not to log it?

mod_log_config may be an option but I didn't find a good answer.

Best Answer

I've not tested this, but, if you set an environment variable you should be able to switch which file it logs to:

SetEnvIf Request_URI "/fogbugz/heartbeat\.asp$" is_heartbeat_request=1
CustomLog /var/log/httpd/heartbeat_log combined env=is_heartbeat_request
CustomLog /var/log/httpd/access_log combined env=!is_heartbeat_request