Skip to content

Instantly share code, notes, and snippets.

@skatkov
Created July 4, 2015 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skatkov/3570e95aa2514f1b9418 to your computer and use it in GitHub Desktop.
Save skatkov/3570e95aa2514f1b9418 to your computer and use it in GitHub Desktop.
Honeybadger :: Rails.logger
class Logger::SimpleFormatter
def call(severity, time, progname, msg)
if Rails.env.production? && (severity == "FATAL" || severity == "ERROR")
@context = { :severity => severity.to_s, :time => time.to_s, :msg => msg.to_s }
Honeybadger.context(@context)
Honeybadger.notify(@context)
end
return "[#{severity}] #{msg}\n"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment