aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/lib
diff options
context:
space:
mode:
authorJacek Lachowski <jacek.lachowski@toptal.com>2017-10-13 14:00:20 +0200
committerJacek Lachowski <jacek.lachowski@toptal.com>2017-11-24 10:40:16 +0100
commitb1fbb6688c9e7b1909ca3ab71691822fc32daf1c (patch)
treeedac843d33ef0898c133184b17f782f0f6204fa1 /activejob/lib
parenta7d7277f947dcbe31870af9f03a42d56d2b60fcc (diff)
downloadrails-b1fbb6688c9e7b1909ca3ab71691822fc32daf1c.tar.gz
rails-b1fbb6688c9e7b1909ca3ab71691822fc32daf1c.tar.bz2
rails-b1fbb6688c9e7b1909ca3ab71691822fc32daf1c.zip
Improve DelayedJob wrapper logging
ActiveJob wraps every adapter into its own class, that is later passed into DelayedJob which is responsible for displaying all the logs. This change improves the logging so we can easily trace executed jobs and see meaningful information in the logs.
Diffstat (limited to 'activejob/lib')
-rw-r--r--activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb b/activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb
index 1978179948..8eeef32b99 100644
--- a/activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb
+++ b/activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb
@@ -34,6 +34,10 @@ module ActiveJob
@job_data = job_data
end
+ def display_name
+ "#{job_data['job_class']} [#{job_data['job_id']}] from DelayedJob(#{job_data['queue_name']}) with arguments: #{job_data['arguments']}"
+ end
+
def perform
Base.execute(job_data)
end