[ActiveJob] Filter sensitive arguments by default

Hi!

GDPR set some restrictions on us. One of them is avoiding logging sensitive data like a credit card number.

Recently we encountered an issue with having some undesired details in our logs due to ActiveJobs logging mechanism. Recently Add an option to disable logging for jobs with sensitive arguments by rafaelfranca · Pull Request #37660 · rails/rails · GitHub was merged, however, it has one drawback. It allows disabling all logs produced by a background job.

I thought that we can make usage of Rails.application.config.filter_parameters configuration option and make usage of it to have jobs’ sensitive arguments filtered by default.

You can find my proposition here: https://github.com/springerigor/rails/commit/02084de54d4b6c0c5861b33019a8f550b1e1ac84.

Waiting for your opinions. Thanks in advance :slightly_smiling_face:

1 Like