Sha256: b9e4e6a9296f5e7147e4bfff9230625884c3412918f285cc8ba1367f377af64f

Contents?: true

Size: 635 Bytes

Versions: 1

Compression:

Stored size: 635 Bytes

Contents

# frozen_string_literal: true

module Loggery
  module Sidekiq
    module Setup
      def self.setup
        ::Sidekiq.configure_server do |config|
          config.logger = Rails.logger

          config.server_middleware do |chain|
            chain.add Loggery::Metadata::Middleware::Sidekiq
          end

          # Sidekiq by default logs deeply nested json which throws off the json logger and elasticsearch.
          # We therefore want to use our own logger that serializes this hash
          config.error_handlers.clear
          config.error_handlers << SidekiqExceptionLogger.new
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
loggery-0.3.0 lib/loggery/sidekiq/setup.rb