Skip to content

Commit

Permalink
chore: Add website_token into request logs (#8362)
Browse files Browse the repository at this point in the history
- Log website_token into request logs to identify specific widgets
  • Loading branch information
sojan-official committed Nov 16, 2023
1 parent a023eab commit 5f6e974
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion config/initializers/filter_parameter_logging.rb
Expand Up @@ -2,5 +2,11 @@

# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [
:password, :secret, :token, :_key, :auth, :crypt, :salt, :certificate, :otp, :access, :private, :protected, :ssn
:password, :secret, :_key, :auth, :crypt, :salt, :certificate, :otp, :access, :private, :protected, :ssn
]

# Regex to filter all occurrences of 'token' in keys except for 'website_token'
filter_regex = /\A(?!.*\bwebsite_token\b).*token/i

# Apply the regex for filtering
Rails.application.config.filter_parameters += [filter_regex]

0 comments on commit 5f6e974

Please sign in to comment.