logbeat
is a Logrus Hook to report errors to Opbeat.
go get https://github.com/xentek/logbeat
import "github.com/xentek/logbeat"
package main
import (
"os"
log "github.com/sirupsen/logrus"
logbeat "github.com/xentek/logbeat"
)
func init() {
orgId := os.Getenv("OPBEAT_ORGANIZATION_ID")
appId := os.Getenv("OPBEAT_APP_ID")
token := os.Getenv("OPBEAT_SECRET_TOKEN")
log.AddHook(logbeat.NewOpbeatHook(orgId, appId, token))
}
func main() {
log.WithField("notify", "opbeat").Error("This error will be sent to Opbeat")
}
Refer to our Contributor's Guide to learn how you can participate in this project.