Reputation: 349
After an email has been delivered, the entire content of the email is visible in the logs in production, which is really messy. Can I remove the email content from the logs just in production?
Upvotes: 11
Views: 2209
Reputation: 636
You may also consider setting the log level of your whole application in production to something less verbose than :debug
. That way you will still log info about the mails being sent, but without the content:
# config/environments/production.rb
Rails.application.configure do
...
config.log_level = :info
...
end
Upvotes: 6
Reputation: 5182
ActionMailer::Base.logger = nil
or in your config/environments/{development,test,production}.rb, add :
Rails.application.configure do
...
config.action_mailer.logger = nil
...
end
Upvotes: 9