Forum: Ruby on Rails Suppressing log messages for an action

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fe60aba68cb3d50f13ac9e13c15f84d5?d=identicon&s=25 Adam (Guest)
on 2009-02-10 13:05
(Received via mailing list)
Hi all,

I have a rails app that regularly pings the server to check for
changes. The problem I'm having is that my "ping" action is printing
so much output to the log that it's swamping any useful data. Is there
a way to turn off the log for a specific action? Ideally I'd like it
to print to the log only if there's an error, but I'd be quite happy
to just turn off the log altogether for the ping action. I'm using the
default Rails logger.

Many thanks,
Adam
Bbbc7c2470ee942c9fd13abebb709b4f?d=identicon&s=25 Brent Miller (macstruan)
on 2009-02-10 18:30
Have you looked at BufferedLogger#silence?

http://apidock.com/rails/ActiveSupport/BufferedLog...

Adam wrote:
> Hi all,
>
> I have a rails app that regularly pings the server to check for
> changes. The problem I'm having is that my "ping" action is printing
> so much output to the log that it's swamping any useful data. Is there
> a way to turn off the log for a specific action? Ideally I'd like it
> to print to the log only if there's an error, but I'd be quite happy
> to just turn off the log altogether for the ping action. I'm using the
> default Rails logger.
>
> Many thanks,
> Adam
This topic is locked and can not be replied to.