Skip to content

Commit 5dbe395

Browse files
authored
docs: add suggestion to filter out base64 params (#81)
1 parent 95ce093 commit 5dbe395

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,16 @@ For example:
181181
data:image/png;base64,[base64 data]
182182
```
183183

184+
### Avoid bloating logs
185+
186+
Because we use strings to pass data in params, if you are not careful, these long strings will show up in your production logs, causing a lot of bloat. To avoid this, filter your base64 params:
187+
```diff
188+
# config/initializers/filter_parameter_logging.rb
189+
190+
- Rails.application.config.filter_parameters += [:password]
191+
+ Rails.application.config.filter_parameters += [:password, :avatar, :pictures, :file]
192+
```
193+
184194
## Contributing
185195

186196
Please read our [CONTRIBUTING](https://github.com/rootstrap/active-storage-base64/blob/master/CONTRIBUTING.md) and our [CODE_OF_CONDUCT](https://github.com/rootstrap/active-storage-base64/blob/master/CODE_OF_CONDUCT.md) files for details on our code of conduct, and the process for submitting pull requests to us.

spec/dummy/config/initializers/filter_parameter_logging.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# Be sure to restart your server when you modify this file.
44

55
# Configure sensitive parameters which will be filtered from the log file.
6-
Rails.application.config.filter_parameters += [:password]
6+
Rails.application.config.filter_parameters += [:password, :avatar, :pictures, :file]

0 commit comments

Comments
 (0)