Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setting the logger to be the Active Job logger changes the behavior compared to using logger directly on the job. The reason is that previously we ended up logging to Rails.logger, because when ActiveJob initializes itself in the context of a Rails application, it sets its logger to the Rails one: https://github.com/rails/rails/blob/v7.0.7.2/activejob/lib/active_job/railtie.rb#L13-L15 Whereas saving the value of ActiveJob::Base.logger early will use the default Active Job logger which logs to stdout: https://github.com/rails/rails/blob/v7.0.7.2/activejob/lib/active_job/logging.rb#L11 This prevents early binding and keeps the pre-1.4.0 behavior of using the current value of ActiveJob::Base.logger during jobs.
- Loading branch information