# Log\_level question

**URL:** <https://www.ruby-forum.com/t/log-level-question/85939>\
**Category:** Rails\
**Created:** [February 17, 2007, 10:16pm UTC](https://www.ruby-forum.com/t/log-level-question/85939 "2007-02-17T22:16:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [February 17, 2007, 10:16pm UTC](https://www.ruby-forum.com/t/log-level-question/85939/1 "2007-02-17T22:16:27Z")

</div>

Could someone point me to the valid values for log\_level? I can’t find  
anything but :debug and :info.

I’m trying to turn off logging of the params values. Is that possible?  
Or do I have to turn off logging of the request / response altogether?  
I assume I could to that pointing the log to /dev/null. Yes?

Thanks,  
Bill

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [February 17, 2007, 10:21pm UTC](https://www.ruby-forum.com/t/log-level-question/85939/2 "2007-02-17T22:21:28Z")

</div>

On 17-Feb-07, at 4:15 PM, Bill W. wrote:

> Could someone point me to the valid values for log\_level? I can’t  
> find anything but :debug and :info.
> 
> I’m trying to turn off logging of the params values. Is that  
> possible? Or do I have to turn off logging of the request /  
> response altogether? I assume I could to that pointing the log to /  
> dev/null. Yes?
> 
> Thanks,  
> Bill

This might be a little more than what you’re asking - but the  
customizations look to be just the ticket:

[http://antrover.com/blog\_test/articles/2006/11/29/ruby\_and\_rails\_logging](http://antrover.com/blog_test/articles/2006/11/29/ruby_and_rails_logging)

Cheers,  
Jodi  
General Partner  
The nNovation Group inc.  
www.nnovation.ca/blog  
ï¿¼

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [February 17, 2007, 10:51pm UTC](https://www.ruby-forum.com/t/log-level-question/85939/3 "2007-02-17T22:51:33Z")

</div>

Hi Jodi,

Jodi S. wrote:

> This might be a little more than what you’re asking
> 
> - but the customizations look to be just the ticket:
> 
> [http://antrover.com/blog\_test/articles/2006/11/29/ruby\_and\_rails\_logging](http://antrover.com/blog_test/articles/2006/11/29/ruby_and_rails_logging)

Thanks much for your reply. I’d read through that already article and  
was  
hoping there might be another setting for the default logger that I just  
didn’t know about. I’m not sure what my hosting service will let me do  
wrt  
changing the logger.

Best regards,  
Bill

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [February 18, 2007, 1:03am UTC](https://www.ruby-forum.com/t/log-level-question/85939/4 "2007-02-18T01:03:41Z")

</div>

Bill:

> Could someone point me to the valid values for log\_level? I can’t find  
> anything but :debug and :info.
> 
> I’m trying to turn off logging of the params values. Is that possible?

In addition to Jodi’s answer, you might also have a look at  
ActionController::Base.filter\_parameter\_logging method  
to filter params values.

See :

> **[ActionController::Base](https://api.rubyonrails.org/classes/ActionController/Base.html#M000260)**
>
> Action Controllers are the core of a web request in Rails. They are made up of one or more actions that are executed on request and then either it renders a template or redirects to another action.

> Or do I have to turn off logging of the request / response altogether?  
> I assume I could to that pointing the log to /dev/null. Yes?

Logging is important, you shouldn’t disable it completely imho.

– Jean-François.

–  
Ruby ( [http://www.rubyfrance.org](http://www.rubyfrance.org) ) on Rails ( [http://www.railsfrance.org](http://www.railsfrance.org)  
)

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [February 18, 2007, 4:47am UTC](https://www.ruby-forum.com/t/log-level-question/85939/5 "2007-02-18T04:47:54Z")

</div>

Hi Jean-François;

Jean-François Trân wrote:

> In addition to Jodi’s answer, you might also have a look at  
> ActionController::Base.filter\_parameter\_logging method  
> to filter params values.

Thank you very much for that. I hadn’t discovered that method before  
and,  
with a little experimenting, it may be just the thing. I really don’t  
want  
to turn off logging; just get rid of the params values in the log.

Best regards,  
Bill

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [February 17, 2007, 11:03pm UTC](https://www.ruby-forum.com/t/log-level-question/85939/6 "2007-02-17T23:03:34Z")

</div>

My bad on two counts. 1) the logger is in Ruby, not Rails. 2) the  
article  
had a link to the Ruby doc on logger. The answer my question about  
valid  
logging levels is at [http://www.ruby-doc.org/stdlib/libdoc/logger/rdoc/](http://www.ruby-doc.org/stdlib/libdoc/logger/rdoc/)

hth someone in the future.

Bill
