# Shutting of console output of params in development mode

**URL:** <https://www.ruby-forum.com/t/shutting-of-console-output-of-params-in-development-mode/118794>\
**Category:** Rails\
**Created:** [October 31, 2007, 12:27am UTC](https://www.ruby-forum.com/t/shutting-of-console-output-of-params-in-development-mode/118794 "2007-10-31T00:27:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ktheory](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e480ec/32.png) [@ktheory](https://www.ruby-forum.com/u/ktheory)\
**Post date:** [October 31, 2007, 12:27am UTC](https://www.ruby-forum.com/t/shutting-of-console-output-of-params-in-development-mode/118794/1 "2007-10-31T00:27:43Z")

</div>

Is there a way to stop rails from showing what is in the “params” hash  
when calling a controller action in development mode?

Thanks

---

<div class="post-metadata">

**Author:** ![ktheory](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e480ec/32.png) [@ktheory](https://www.ruby-forum.com/u/ktheory)\
**Post date:** [October 31, 2007, 12:36am UTC](https://www.ruby-forum.com/t/shutting-of-console-output-of-params-in-development-mode/118794/2 "2007-10-31T00:36:56Z")

</div>

On Oct 30, 11:27 pm, Aaron S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Is there a way to stop rails from showing what is in the “params” hash  
> when calling a controller action in development mode?

Have you tried increasing config.log\_level ?

Fred

---

<div class="post-metadata">

**Author:** ![ktheory](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e480ec/32.png) [@ktheory](https://www.ruby-forum.com/u/ktheory)\
**Post date:** [October 31, 2007, 12:44am UTC](https://www.ruby-forum.com/t/shutting-of-console-output-of-params-in-development-mode/118794/3 "2007-10-31T00:44:26Z")

</div>

Frederick C. wrote:

> On Oct 30, 11:27 pm, Aaron S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > Is there a way to stop rails from showing what is in the “params” hash  
> > when calling a controller action in development mode?
> 
> Have you tried increasing config.log\_level ?
> 
> Fred

well the thing is. we can do that. but then logging for everything is  
turned down. I still want to see logging. but shut off the dumping of  
params

---

<div class="post-metadata">

**Author:** ![ktheory](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e480ec/32.png) [@ktheory](https://www.ruby-forum.com/u/ktheory)\
**Post date:** [October 31, 2007, 1:14am UTC](https://www.ruby-forum.com/t/shutting-of-console-output-of-params-in-development-mode/118794/4 "2007-10-31T01:14:22Z")

</div>

> well the thing is. we can do that. but then logging for everything is  
> turned down. I still want to see logging. but shut off the dumping of  
> params

Perhaps with a little bit of fiddling you could use  
filter\_paramter\_logging to ensure it matches every parameter? Not sure  
if  
that just hides the value or removes it entirely, but maybe that would  
help?

filter\_parameter\_logging(\*filter\_words) {|key, value| …}

Replace sensitive paramater data from the request log. Filters  
paramaters  
that have any of the arguments as a substring. Looks in all subhashes of  
the param hash for keys to filter. If a block is given, each key and  
value  
of the paramater hash and all subhashes is passed to it, the value or  
key  
can be replaced using String#replace or similar method.

Examples:

filter\_parameter\_logging  
=\> Does nothing, just slows the logging process down

filter\_parameter\_logging :password  
=\> replaces the value to all keys matching /password/i with  
“[FILTERED]”

filter\_parameter\_logging :foo, “bar”  
=\> replaces the value to all keys matching /foo|bar/i with  
“[FILTERED]”

filter\_parameter\_logging { |k,v| v.reverse! if k =~ /secret/i }  
=\> reverses the value to all keys matching /secret/i

filter\_parameter\_logging(:foo, “bar”) { |k,v| v.reverse! if k =~  
/secret/i }  
=\> reverses the value to all keys matching /secret/i, and  
replaces the value to all keys matching /foo|bar/i with  
“[FILTERED]”
