https://github.com/xentek/logbeat
Logbeat is a Logrus Hook to report errors to Opbeat
https://github.com/xentek/logbeat
go golang logging logrus logrus-hook opbeat
Last synced: 4 months ago
JSON representation
Logbeat is a Logrus Hook to report errors to Opbeat
- Host: GitHub
- URL: https://github.com/xentek/logbeat
- Owner: xentek
- License: mit
- Created: 2017-10-17T17:39:08.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-08T19:37:16.000Z (over 8 years ago)
- Last Synced: 2026-01-13T18:26:36.057Z (5 months ago)
- Topics: go, golang, logging, logrus, logrus-hook, opbeat
- Language: Go
- Size: 26.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# logbeat [](https://travis-ci.org/xentek/logbeat) [](https://godoc.org/github.com/xentek/logbeat) [](https://goreportcard.com/report/github.com/xentek/logbeat) [](https://coveralls.io/github/xentek/logbeat) [](https://github.com/xentek/logbeat/blob/master/LICENSE)
`logbeat` is a [Logrus](https://github.com/sirupsen/logrus) Hook to report errors to [Opbeat](https://opbeat.com/).
---
## Install
go get https://github.com/xentek/logbeat
## Import
import "github.com/xentek/logbeat"
## Usage
```go
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")
}
```
## Contributing
Refer to our [Contributor's Guide](CONTRIBUTING.md) to learn how you can participate in this project.
## More Info
- [GoDoc](https://godoc.org/github.com/xentek/logbeat)
- [Wiki](https://github.com/xentek/logbeat/wiki)