title: Best way to log ActionMailer sent emails in a database?
body: <p>I need to log emails sent through ActionMailer and a simple text file isn't enough. I'd need to store the logs in an ActiveRecord model. Email sending performance will likely take a hit, but in this case, it's the best alternative (since the logs are afterwards routinely accessed by the app).</p>
  
  <p>I'd also need to log what was actually sent and the errors associated, not just what my controller passes to ActionMailer (ie. the lowest level implementation possible).</p>
  
  <p><code>config.action_mailer.logger</code> seems an ideal way to hijack the machinery already in place by Rails to do so. However, from my understanding, Log4r and the default Ruby logger can only output to text files.</p>
  
  <p>Any suggestions?</p>
  
  <p>Thanks!</p>