# Turning off logging for a function

**URL:** <https://www.ruby-forum.com/t/turning-off-logging-for-a-function/114250>\
**Category:** Rails\
**Created:** [September 10, 2007, 3:57pm UTC](https://www.ruby-forum.com/t/turning-off-logging-for-a-function/114250 "2007-09-10T15:57:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![simplydope](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d26b3c/32.png) [@simplydope](https://www.ruby-forum.com/u/simplydope)\
**Post date:** [September 10, 2007, 3:57pm UTC](https://www.ruby-forum.com/t/turning-off-logging-for-a-function/114250/1 "2007-09-10T15:57:57Z")

</div>

I swear I posted this a few hours ago but I can’t see it!!!

Does anybody know a way to turn off logging for a few LOC/block, a  
function or even a class?

Why would you want to do that? Well we have a script that checks  
yesterdays logs for errors and then emails the results to us. The  
emailing processing logs the email sent which means that its contents  
are then picked up again the next day. Consequently we have an ever  
increasing log report!

---

<div class="post-metadata">

**Author:** ![simplydope](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d26b3c/32.png) [@simplydope](https://www.ruby-forum.com/u/simplydope)\
**Post date:** [September 10, 2007, 4:09pm UTC](https://www.ruby-forum.com/t/turning-off-logging-for-a-function/114250/2 "2007-09-10T16:09:36Z")

</div>

On Mon, 10 Sep 2007, George P. wrote:

> I swear I posted this a few hours ago but I can’t see it!!!
> 
> Does anybody know a way to turn off logging for a few LOC/block, a  
> function or even a class?

silence {…}

doc\_root/actionpack-1.13.3/rdoc/index.html

```
    Hugh
```
