Created
September 19, 2012 20:49
-
-
Save masarakki/3752166 to your computer and use it in GitHub Desktop.
hide parameter of json in rails log
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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