Skip to content

Commit 7b5ece9

Browse files
author
kireto
committed
[readme] Adding documentation in the README about Rails and filter_parameters.
ExceptionNotification users the filter_parameters configuration of Rails. Adding explanation and an example. The request is about issue - smartinez87#507
1 parent e9f09b8 commit 7b5ece9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,23 @@ This command generates an initialize file (`config/initializers/exception_notifi
284284

285285
Make sure the gem is not listed solely under the `production` group, since this initializer will be loaded regardless of environment.
286286

287+
#### Filtering params
288+
289+
ExceptionNotification sends a notification containing the parameters of the request. These parameters could contain sensitive and secret information that you don't want to get logged or sent out as an email outside of your system. Example is the secret_key_base.
290+
291+
To filter these parameters you can use the
292+
config/initializers/filter_parameter_logging.rb. An example that filters some of the parameters in a Rails 6 application would be:
293+
294+
```
295+
# config/initializers/filter_parameter_logging.rb
296+
# Configure sensitive parameters which will be filtered from the log file.
297+
Rails.application.config.filter_parameters += [
298+
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
299+
]
300+
```
301+
302+
You can read more about filter_parameters at https://guides.rubyonrails.org/configuring.html#rails-general-configuration
303+
287304
### Resque/Sidekiq
288305

289306
Instead of manually calling background notifications foreach job/worker, you can configure ExceptionNotification to do this automatically. For this, run:

0 commit comments

Comments
 (0)