I need to run some info/debug logging in production environment to find
a very elusive problem.
However, I have load balancers which whack a very simple request very
frequently to ensure the entire app stack is active. I have a controller
with one action dedicated to this monitoring task.
I would really like to stop that entire request from being logged to
eliminate the massive amount of noise it generates with info & debug
messages. So something in the header of the controller would seem
appropriate if possible.
I’ve seen several questions like mine, but no solid answers. I’ve tried
the suggestions found here to no avail.
On Mon, Sep 28, 2009 at 7:22 PM, Greg W. <
class PulseController
def logger
end
Heh, that’s brute force but simple It supresses messages from the
controller alright, but doesn’t supress the database query as part of
that action’s chores (doing a mysql ping as part of the stack check).
def my_action
ActiveRecord::Base.silence do
… nothing AR related will show up in the logs…
end
end
Search the rails source for “silence” to make sure I’ve got that down
right.
Hmm, logical but nope. Still getting queries logged, but that may be
because I used this technique to add timestamps and log level info to
the log output. Maybe there’s interference. (how could anyone think
timestamps would not be useful in a log ???).