sidekiq
sidekiq copied to clipboard
Allow user to disable default job logging
This PR adds a new configuration knob, :skip_default_job_logging, to disable job logging out of the box, see #6199.
The user can choose when and where to disable the logging. I would recommend leaving it enabled for a reasonable developer experience but in environments like a high-volume production setup, logging output can be significant. This allows the user to opt-out of the logging if it becomes an issue.
Sidekiq.configure_server do |config|
# disable job logging in production
config[:skip_default_job_logging] = (config[:environment] == "production")
# disable sidekiq's job logging everywhere
config[:skip_default_job_logging] = true
end
This does change the JobLogger constructor. Since that's a breaking change to an internal component, it'll need a minor version bump to 7.3.0.
Is there any reason why the config.skip_default_job_logging = true syntax doesn't work here? Seems out of place with the rest of the config:
config.redis = Redis.config_sidekiq
config.logger = Sidekiq::Logger.new($stdout)
config.logger.level = ENV.fetch('SIDEKIQ_LOG_LEVEL', 'info')
config[:skip_default_job_logging] = (config[:environment] == 'production')
config.super_fetch!
config.reliable_scheduler!
Yes, it was not deemed important enough option to justify accessors on Sidekiq::Config.
will this work with version 6.1.2 ?