diff options
Diffstat (limited to 'lib/active_job/logging.rb')
-rw-r--r-- | lib/active_job/logging.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/active_job/logging.rb b/lib/active_job/logging.rb index f4a33ffe19..ede1606027 100644 --- a/lib/active_job/logging.rb +++ b/lib/active_job/logging.rb @@ -4,11 +4,9 @@ module ActiveJob module Logging extend ActiveSupport::Concern - module ClassMethods - mattr_accessor(:logger) { ActiveSupport::Logger.new(STDOUT) } - end - included do + cattr_accessor(:logger) { ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new(STDOUT)) } + before_enqueue do |job| if job.enqueued_at ActiveSupport::Notifications.instrument "enqueue_at.active_job", @@ -24,8 +22,7 @@ module ActiveJob adapter: job.class.queue_adapter, job: job.class, args: job.arguments end end - - + class LogSubscriber < ActiveSupport::LogSubscriber def enqueue(event) info "Enqueued #{event.payload[:job].name} to #{queue_name(event)}" + args_info(event) |