Class: Hutch::ErrorHandlers::Logger

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/hutch/error_handlers/logger.rb

Instance Method Summary collapse

Methods included from Logging

#logger, logger, logger=, setup_logger

Instance Method Details

#handle(message_id, payload, consumer, ex) ⇒ Object



8
9
10
11
12
13
# File 'lib/hutch/error_handlers/logger.rb', line 8

def handle(message_id, payload, consumer, ex)
  prefix = "message(#{message_id || '-'}): "
  logger.error prefix + "error in consumer '#{consumer}'"
  logger.error prefix + "#{ex.class} - #{ex.message}"
  logger.error (['backtrace:'] + ex.backtrace).join("\n")
end