Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Airbrake Hook for Logrus :walrus: Build Status godoc reference

Use this hook to send your errors to Airbrake. This hook is using the official airbrake go package, and will hit the api V3. The hook is synchronous and will send the error for log.Error, log.Fatal and log.Panic levels.

All logrus fields will be sent as context fields on Airbrake.

Usage

The hook must be configured with:

  • A project ID (found in your your Airbrake project settings)
  • An API key ID (found in your your Airbrake project settings)
  • The name of the current environment ("development", "staging", "production", ...)
  • The Stack Level Trace You Want to Begin With
  • If you want Airbrake to fire synchronous or not
import (
    "log/syslog"
    "github.com/Invoiced/logrus"
    "github.com/Invoiced/logrus-airbrake-hook" // the package is named 
    )

func main() {
    log.AddHook(airbrake.NewHook(123, "xyz", "production",3,true))
    log.Error("some logging message") // The error is sent to airbrake in background
}

About

Airbrake hook for logrus, using the official gobrake package

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages