logrusbadger
is a logrus-compatible hook that uses the official Honeybadger go library to notify Honeybadger.
Any fields included with the log message will be added to the context of the honeybadger notification, and the main message of the log will be used as it's type. Any error added using logrus's WithError
function will be set as the exception's type. This encourages you to use generic error messages like retrieving current user
as your message, while added specific details as additional fields.
Just register the hook with logrus. All configuration (API keys, timeouts, etc) should happen via Honeybadger's official libraries.
log.AddHook(logrusbadger.NewHook())
This library is MIT licensed. See the LICENSE file in this repository for details.