Commit db32e959 authored by Sean McGivern's avatar Sean McGivern

Fix Sidekiq JSON logging

The 'Listening on queues' message was logged before we set the log
format (if enabled) to JSON, so it would never be in JSON. We can just
move it to later to ensure that it uses the correct format.
parent e9755388
......@@ -30,8 +30,6 @@ Sidekiq.configure_server do |config|
config.options[:strict] = false
config.options[:queues] = Gitlab::SidekiqConfig.expand_queues(config.options[:queues])
Sidekiq.logger.info "Listening on queues #{config.options[:queues].uniq.sort}"
if enable_json_logs
config.log_formatter = Gitlab::SidekiqLogging::JSONFormatter.new
config.options[:job_logger] = Gitlab::SidekiqLogging::StructuredLogger
......@@ -41,6 +39,8 @@ Sidekiq.configure_server do |config|
config.error_handlers.reject! { |handler| handler.is_a?(Sidekiq::ExceptionHandler::Logger) }
end
Sidekiq.logger.info "Listening on queues #{config.options[:queues].uniq.sort}"
config.redis = queues_config_hash
config.server_middleware(&Gitlab::SidekiqMiddleware.server_configurator(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment