# Suppressing log messages for an action

**URL:** <https://www.ruby-forum.com/t/suppressing-log-messages-for-an-action/159959>\
**Category:** Rails\
**Created:** [February 10, 2009, 1:05pm UTC](https://www.ruby-forum.com/t/suppressing-log-messages-for-an-action/159959 "2009-02-10T13:05:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4af34b/32.png) [@adam](https://www.ruby-forum.com/u/adam)\
**Post date:** [February 10, 2009, 1:05pm UTC](https://www.ruby-forum.com/t/suppressing-log-messages-for-an-action/159959/1 "2009-02-10T13:05:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![adam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4af34b/32.png) [@adam](https://www.ruby-forum.com/u/adam)\
**Post date:** [February 10, 2009, 6:30pm UTC](https://www.ruby-forum.com/t/suppressing-log-messages-for-an-action/159959/2 "2009-02-10T18:30:33Z")

</div>

Have you looked at BufferedLogger#silence?

[http://apidock.com/rails/ActiveSupport/BufferedLogger/silence](http://apidock.com/rails/ActiveSupport/BufferedLogger/silence)

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
