Sha256: 55271d2c306b82d86f6b74c937d0c305603c55a09ffc04fbbe2af655b34a75f9
Contents?: true
Size: 616 Bytes
Versions: 41
Compression:
Stored size: 616 Bytes
Contents
class SidekiqLogsterReporter def call(ex, context={}) # Pass context to Logster fake_env = {} context.each do |key, value| Logster.add_to_env(fake_env, key, value) end text = "Job exception: #{ex}\n" if ex.backtrace Logster.add_to_env(fake_env, :backtrace, ex.backtrace) end Thread.current[Logster::Logger::LOGSTER_ENV] = fake_env Logster.logger.error(text) rescue => e Logster.logger.fatal("Failed to log exception #{ex} #{hash}\nReason: #{e.class} #{e}\n#{e.backtrace.join("\n")}") ensure Thread.current[Logster::Logger::LOGSTER_ENV] = nil end end
Version data entries
41 entries across 41 versions & 1 rubygems