dariush
dariush

Reputation: 3341

rails5 `filter_parameters` doesn't work

I have the following in my config/initializers/filter_parameter_logging.rb

# Be sure to restart your server when you modify this file.

# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [:password, :reset_password_token, :confirmation_token, :unlock_token, :two_step_auth_token]

But when I execute and update for two_step_auth_token column the log is not filtered, even though I restarted the server:

UPDATE `users` SET `two_step_auth_token` = 'tb0437', `two_step_auth_token_sent_at` = '2017-04-29 20:12:49', `two_step_auth_token_confirmed_at` = NULL, `updated_at` = '2017-04-29 20:12:49' WHERE `users`.`id` = 1

What is wrong and how can I fix it?

Upvotes: 0

Views: 541

Answers (1)

Roman Kiselenko
Roman Kiselenko

Reputation: 44370

You can filter out sensitive request parameters from your log files, not a sql queries.

ref

Upvotes: 1

Related Questions