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
Post a Comment