Class: ApiHammer::RailsOrSidekiqLoggerMiddleware

Inherits:
Object
  • Object
show all
Defined in:
lib/api_hammer/rails_or_sidekiq_logger.rb

Overview

switch a logger between Rails.logger and sidekiq's logger

Sidekiq.configure_server do |config|
  ...

  config.server_middleware do |chain|
    chain.add ApiHammer::RailsOrSidekiqLoggerMiddleware
  end
end

Instance Method Summary collapse

Instance Method Details

#call(worker, msg, queue, &block) ⇒ Object



12
13
14
# File 'lib/api_hammer/rails_or_sidekiq_logger.rb', line 12

def call(worker, msg, queue, &block)
  ApiHammer::RailsOrSidekiqLogger.with_logger(worker.logger, &block)
end