My name is Josh Szmajda. I'm a long-time coder with experience in Ruby, Perl, Bash, PHP, and Java, as well as some exposure to Python, C, C++, VB, Lisp, Haskell, Erlang, and a bunch more. I'm big into Linux and Open Source in general. I'm the CTO at Optoro, where we help retailers with returned inventory.
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.