logging - How to filter nested parameters from Rails logs -


i see can filter keys rails logs here, it's not entirely clear how can filter key nested inside parameter hash.

my params hash looks this:

{"download"=>{"attachment_id"=>"54039", "data"=>"data:image/png;base64,ivborw0..."}} 

where params[:download][:data] base64 string. large amount of data , remove logs.

is possible?

i'm using rails 4.0.4

simply put in application.rb:

config.filter_parameters += [:data]

this filter nested [:data] keys also.

in rails 5, can define hierarchy of key:

config.filter_parameters += ["download.data"]

this filter [:data] keys have [:download] immediate parent.


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -