I had some fields that were sensitive, so I didn’t want the values appearing in the logs. The solution was filtering them. Doing that was easy.
In config/initializers/filter_parameter_logging.rb, and your fields, like so:
Rails.application.config.filter_parameters += [:password, :secret_field]
Now, when I look at the logs, I see this:
I had some errors occurring in my controller, but it wasn’t displaying in my views. So I had to figure out how to see what was happening since I didn’t see any messages in the logs that were helpful either.
I found the solution in one of the answers here on Stack Overflow.
By adding this to my controller (it was the creation of a model – @user):
This recorded the error in my logs (one of my model validations needed to be changed).