Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Log DJ ActiveRecord activity to a separate log file
Delayed::Worker.logger = ActiveSupport::BufferedLogger.new("log/#{Rails.env}_delayed_jobs.log", Rails.logger.level)
Delayed::Worker.logger.auto_flushing = 1
if caller.last =~ /.*\/script\/delayed_job:\d+$/
Rails.logger = Delayed::Worker.logger
ActiveRecord::Base.logger = Delayed::Worker.logger
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment