Today I Learned

hashrocket A Hashrocket project

Parameters Filtering

Rails logs your server's activity, which is useful for development and debugging. However, often the server handles sensitive information that should not be logged.

A few examples are authentication credentials, personal data, and financial information.

To prevent Rails from logging such data, add this to your application configuration:

config.filter_parameters << :param_a, :param_b

When the named parameters are handled by the server, they will be logged as [FILTERED] instead of their actual value. Add this configuration by environment if you want to keep the parameters unfiltered in development.

See More #rails TILs
Looking for help? Hashrocket has been an industry leader in Ruby on Rails since 2008. Rails is a core skill for each developer at Hashrocket, and we'd love to take a look at your project. Contact us and find out how we can help you.