Reputation: 45
In my Rails project I send email with ActionMailer and add attachment (pdf file). And when this email creating, in server log I see a loooooong (realy long - I can't scroll up to start) string - base64 encoded attachment.
Question: Can I turn off logging base64 encoded mails in my app?
Upvotes: 4
Views: 474
Reputation: 683
First off, you can disable specific parts of your log like so:
Rails.application.config.filter_parameters += [
:password,
:encoded_key,
]
I believe :encoded_key
is the big ActiveStorage one, but just look in your log to silence what you want.
Another alternative is the fantastic LogRage gem. I personally use this for a lot of things, but it gives you very granular control over your logging. It also makes it easy to export logs to other services if you ever end up doing so in the future.
Upvotes: 1