Aaron Smith
2007-Oct-30 23:27 UTC
shutting of console output of params in development mode
Is there a way to stop rails from showing what is in the "params" hash when calling a controller action in development mode? Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2007-Oct-30 23:35 UTC
Re: shutting of console output of params in development mode
On Oct 30, 11:27 pm, Aaron Smith <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> 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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Aaron Smith
2007-Oct-30 23:44 UTC
Re: shutting of console output of params in development mode
Frederick Cheung wrote:> On Oct 30, 11:27 pm, Aaron Smith <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > 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 ? > > Fredwell 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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2007-Oct-31 02:30 UTC
Re: shutting of console output of params in development mode
> Frederick Cheung wrote: >> On Oct 30, 11:27 pm, Aaron Smith <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> >> 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 > paramsPerhaps 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]" --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---