Skip to content
This repository has been archived by the owner on Jun 11, 2022. It is now read-only.

Latest commit

 

History

History
17 lines (10 loc) · 1.06 KB

README.md

File metadata and controls

17 lines (10 loc) · 1.06 KB

logrusbadger GoDoc

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.

Usage

Just register the hook with logrus. All configuration (API keys, timeouts, etc) should happen via Honeybadger's official libraries.

log.AddHook(logrusbadger.NewHook())

License

This library is MIT licensed. See the LICENSE file in this repository for details.