I'm using ActiveJob to manage my jobs, and I have the following ApplicationJob
:
class ApplicationJob < ActiveJob::Base # [...] before_perform do |job| Rails.logger.info 'before_perform callback triggered' # This doesn't log end # [...]end
Additionally, I have another job that inherits from ApplicationJob
:
class MyJob < ApplicationJob def perform # do something Rails.logger.info 'perform method called' # This logs correctly endend
I've configured my logger to write to a file, and while the logs inside the perform
method are written to the file as expected, the logs from the before_perform
callback don't appear at all.
For context, I'm invoking the jobs using both perform_now
and perform_later
methods, but neither seems to trigger the before_perform
log.
Thanks in advance!