# Silence the logger during tests

**URL:** <https://www.ruby-forum.com/t/silence-the-logger-during-tests/145071>\
**Category:** Rails\
**Created:** [August 5, 2008, 7:12pm UTC](https://www.ruby-forum.com/t/silence-the-logger-during-tests/145071 "2008-08-05T19:12:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewkendall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b77776/32.png) [@andrewkendall](https://www.ruby-forum.com/u/andrewkendall)\
**Post date:** [August 5, 2008, 7:12pm UTC](https://www.ruby-forum.com/t/silence-the-logger-during-tests/145071/1 "2008-08-05T19:12:00Z")

</div>

Hello,

I have some tests that generate a lot of NOTICE messages from the logger  
and I’d like to silence them for certain sections of the tests.

I’ve tried using…  
RAILS\_DEFAULT\_LOGGER.silence { }

but that seems to have no effect at all.

Can somebody tell me how I can go about silencing the messages that  
appear during the tests?

Thanks
