aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib/action_mailer/log_subscriber.rb
diff options
context:
space:
mode:
authorDaniel Schierbeck <dasch@zendesk.com>2013-10-16 10:32:06 +0200
committerDaniel Schierbeck <dasch@zendesk.com>2013-10-20 15:21:15 +0200
commit8f0c5e00ff61cc2f61acedfb35de756bd0e95437 (patch)
tree05b7ace2d4938c8376cdc3580526e279f930f4b8 /actionmailer/lib/action_mailer/log_subscriber.rb
parentcc8d14827d117ed7da7a17c4a057a8e5f71625ca (diff)
downloadrails-8f0c5e00ff61cc2f61acedfb35de756bd0e95437.tar.gz
rails-8f0c5e00ff61cc2f61acedfb35de756bd0e95437.tar.bz2
rails-8f0c5e00ff61cc2f61acedfb35de756bd0e95437.zip
Instrument the generation of Action Mailer messages
The processing of outbound mail is instrumented with the key `process.action_mailer`. The payload includes the mailer name as well as the mailer method.
Diffstat (limited to 'actionmailer/lib/action_mailer/log_subscriber.rb')
-rw-r--r--actionmailer/lib/action_mailer/log_subscriber.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionmailer/lib/action_mailer/log_subscriber.rb b/actionmailer/lib/action_mailer/log_subscriber.rb
index 8467d45986..eb6fb11d81 100644
--- a/actionmailer/lib/action_mailer/log_subscriber.rb
+++ b/actionmailer/lib/action_mailer/log_subscriber.rb
@@ -19,6 +19,13 @@ module ActionMailer
debug(event.payload[:mail])
end
+ # An email was generated.
+ def process(event)
+ mailer = event.payload[:mailer]
+ action = event.payload[:action]
+ debug("\n#{mailer}##{action}: processed outbound mail in #{event.duration.round(1)}ms")
+ end
+
# Use the logger configured for ActionMailer::Base
def logger
ActionMailer::Base.logger