Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maksim-paskal/logrus-hook-sentry
https://github.com/maksim-paskal/logrus-hook-sentry
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/maksim-paskal/logrus-hook-sentry
- Owner: maksim-paskal
- License: apache-2.0
- Created: 2021-01-05T16:50:10.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-07-14T11:37:44.000Z (over 1 year ago)
- Last Synced: 2024-05-19T00:37:18.242Z (8 months ago)
- Language: Go
- Size: 58.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## installation
```
go get github.com/maksim-paskal/logrus-hook-sentry
```
## envieronment
```bash
export SENTRY_DSN=https://[email protected]/345
```## usage
```go
package mainimport (
"errors"logrushooksentry "github.com/maksim-paskal/logrus-hook-sentry"
log "github.com/sirupsen/logrus"
)var ErrTest error = errors.New("test error")
func main() {
hook, err := logrushooksentry.NewHook(logrushooksentry.Options{
Release: "test",
})
if err != nil {
log.WithError(err).Fatal()
}log.AddHook(hook)
log.Info("test info")
log.Warn(ErrTest)
log.WithError(ErrTest).Error("some message")defer hook.Stop()
}
```