We use HAProxy to load-balance requests across multiple Rails backends. It works great, but man does it clutter up the logs. Every N seconds (2 in our case), HAProxy requests our root url (DashboardsController#index) to ensure the site is up. This results in lots of log entries like this:
Every. Two. Seconds.
This made it really hard to read the logs, let alone cap tail. I finally got fed up and created this initializer:
It works with Rails 2.3. I’m sure you can do it with Rails 3 somehow—in fact I’m betting it’s easier in Rails 3—but I’m working with what I’ve got.
And now I can go back to reading the logs like a sane person.