How disable log for entire action?

The way I do it:

class PulseController

def logger

end

def index

render some text if you want a monitor of some sort

end

end

then route whatever your load balancer hits to this controller and you’re good.

Jason

Jason Roelofs wrote:

On Mon, Sep 28, 2009 at 7:22 PM, Greg Willits < class PulseController   def logger   end

Heh, that's brute force but simple :slight_smile: 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).

But I could possibly tinker further.

-- gw

I'm coming in late so maybe this has mentioned...

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.

How about up'ing the logger level temporarily, like

  ...   bak_log_level = logger.level   begin     logger.level = Logger::ERROR     # do some stuff ...     ...   ensure     logger.level = bak_log_level   end   ...

Jeff