Log inside Sidekiq worker
It works in rails 6:
# config/initializers/sidekiq.rb
Rails.logger = Sidekiq.logger
ActiveRecord::Base.logger = Sidekiq.logger
There is a Sidekiq.logger
and simply logger
reference that you can use within your workers. The default should be to STDOUT and you should just direct your output in production to the log file path of your choice.
@migu, have you tried the below command in the config/initializer.rb
?
Rails.logger = Sidekiq::Logging.logger