Skip to content

Instantly share code, notes, and snippets.

@masarakki
Created September 19, 2012 20:49
Show Gist options
  • Save masarakki/3752166 to your computer and use it in GitHub Desktop.
Save masarakki/3752166 to your computer and use it in GitHub Desktop.
hide parameter of json in rails log
config.filter_parameters += [:password, lambda {|k, v|
if k.to_sym == :json
json = JSON.parse(v).symbolize_keys
json[:password] = "[FILTERED]" if json.has_key?(:password)
v.replace json.to_s
end
}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment