Search code examples
ruby-on-railsactionmailer

How do I remove mail html content from Rails' logs?


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?


Solution

  • ActionMailer::Base.logger = nil
    

    or in your config/environments/{development,test,production}.rb, add :

    Rails.application.configure do
      ...
      config.action_mailer.logger = nil
      ...
    end