logrus/hooks/sentry
Roberto Bampi 4e014d4268 added tests 2014-11-02 19:31:15 +01:00
..
README.md added sentry logger 2014-11-01 19:55:40 +01:00
sentry.go added tests 2014-11-02 19:31:15 +01:00
sentry_test.go added tests 2014-11-02 19:31:15 +01:00

README.md

Sentry Hook for Logrus :walrus:

Sentry provides both self-hosted and hostes solutions for exception tracking. Both client and server are open source.

Usage

Every sentry application defined on the server gets a different DNS. In the example below replace YOUR_DSN with the one created for your application.

import (
  "github.com/Sirupsen/logrus"
  "github.com/Sirupsen/logrus/hooks/sentry"
)

func main() {
  log       := logrus.New()
  hook, err := logrus_sentry.NewSentryHook(YOUR_DSN, []logrus.Level{
    logrus.PanicLevel,
    logrus.FatalLevel,
    logrus.ErrorLevel,
  })

  if err == nil {
    log.Hooks.Add(hook)
  }
}