I have an Rails 3.2 based app that uses Sidekiq 2.12 to run background jobs. The Sidekiq jobs can call the same methods as the interactive Rails app. I would like the methods t
Both Sidekiq and Rails use Logger
compliant classes from the Ruby StdLib.
You should be able to re-configure the Rails logger to use the Sidekiq logger in the Sidekiq server config block. Find/create a file like config/inititializers/sidekiq.rb
:
Sidekiq.configure_server do |config|
Rails.logger = Sidekiq::Logging.logger
# Sidekiq other server config
...
end
The block passed to the Sidekiq.configure_server call is only executed within the Server component of the Sidekiq backend, not within the client running in your Rails app server or console.