mirror of https://github.com/sirupsen/logrus.git
updated readme with usage example
This commit is contained in:
parent
8ce3556d31
commit
afe474b84f
|
@ -31,6 +31,22 @@ func main() {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you wish to initialize a SentryHook with tags, you can use the `NewWithTagsSentryHook` constructor to provide default tags:
|
||||||
|
|
||||||
|
```go
|
||||||
|
tags := map[string]string{
|
||||||
|
"site": "example.com",
|
||||||
|
}
|
||||||
|
levels := []logrus.Level{
|
||||||
|
logrus.PanicLevel,
|
||||||
|
logrus.FatalLevel,
|
||||||
|
logrus.ErrorLevel,
|
||||||
|
}
|
||||||
|
hook, err := logrus_sentry.NewWithTagsSentryHook(YOUR_DSN, tags, levels)
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Special fields
|
## Special fields
|
||||||
|
|
||||||
Some logrus fields have a special meaning in this hook,
|
Some logrus fields have a special meaning in this hook,
|
||||||
|
|
Loading…
Reference in New Issue