Class: ActionMailer::LogSubscriber
Do not use. This class is for internal use only.
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
|
|
|
Instance Chain:
|
|
| Inherits: |
ActiveSupport::EventReporter::LogSubscriber
|
| Defined in: | actionmailer/lib/action_mailer/log_subscriber.rb |
Constant Summary
::ActiveSupport::ColorizeLogging - Included
BLACK, BLUE, CYAN, GREEN, MAGENTA, MODES, RED, WHITE, YELLOW
::ActiveSupport::EventReporter::LogSubscriber - Inherited
Class Attribute Summary
::ActiveSupport::EventReporter::LogSubscriber - Inherited
Class Method Summary
::ActiveSupport::EventReporter::LogSubscriber - Inherited
Instance Attribute Summary
Instance Method Summary
-
#delivered(event)
An email was delivered.
-
#processed(event)
An email was generated.
::ActiveSupport::EventReporter::LogSubscriber - Inherited
::ActiveSupport::ColorizeLogging - Included
| #color | Set color by using a symbol or one of the defined constants. |
| #colorize_logging, #debug, #error, #fatal, #info, #mode_from, #unknown, #warn | |
Class Method Details
.default_logger
[ GitHub ]# File 'actionmailer/lib/action_mailer/log_subscriber.rb', line 36
def self.default_logger ActionMailer::Base.logger end
Instance Method Details
#delivered(event)
An email was delivered.
# File 'actionmailer/lib/action_mailer/log_subscriber.rb', line 10
def delivered(event) payload = event[:payload] info do if payload[:exception_class] "Failed delivery of mail #{payload[:]} error_class=#{payload[:exception_class]} error_message=#{payload[:].inspect}" elsif payload[:perform_deliveries] "Delivered mail #{payload[:]} (#{payload[:duration_ms].round(1)}ms)" else "Skipped delivery of mail #{payload[:]} as `perform_deliveries` is false" end end debug { payload[:mail] } end
#processed(event)
An email was generated.
# File 'actionmailer/lib/action_mailer/log_subscriber.rb', line 27
def processed(event) debug do mailer = event[:payload][:mailer] action = event[:payload][:action] "#{mailer}##{action}: processed outbound mail in #{event[:payload][:duration_ms].round(1)}ms" end end