You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Kegan Dougal fcd4b5adc7 Comments 8 years ago
..
LICENSE An extensible Matrix bot written in Go 8 years ago
README.md An extensible Matrix bot written in Go 8 years ago
airbrake.go An extensible Matrix bot written in Go 8 years ago
airbrake_test.go An extensible Matrix bot written in Go 8 years ago

README.md

Airbrake Hook for Logrus :walrus:

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 async for log.Error, but blocking for the notice to be sent with log.Fatal and log.Panic.

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", ...)
import (
    "log/syslog"
    "github.com/Sirupsen/logrus"
    "gopkg.in/gemnasium/logrus-airbrake-hook.v2" // the package is named "aibrake"
    )

func main() {
    log := logrus.New()
    log.AddHook(airbrake.NewHook(123, "xyz", "development"))
    log.Error("some logging message") // The error is sent to airbrake in background
}

Note that if environment == "development", the hook will not send anything to airbrake.