开发者

dynamically filter params values for logging

to capture some errors I would like to through the query strin开发者_StackOverflow中文版g parameters into a log file to help diagnose.

$mylog.info "bad information " + parms.to_json.to_s

However sometimes there is sensitive information, such as a password. I know there is 'filter_parameter_logging' that can be set however doing something like this doesn't work.

params['filter_parameter_logging'] = :password

How would I go about dynamically masking some of the values?


Try adding the following to your class Application

config.filter_parameters += [:password]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜