https://github.com/constructor-io/zerolog-sentry
Sentry writer for zerolog logger
https://github.com/constructor-io/zerolog-sentry
Last synced: 5 months ago
JSON representation
Sentry writer for zerolog logger
- Host: GitHub
- URL: https://github.com/constructor-io/zerolog-sentry
- Owner: Constructor-io
- License: apache-2.0
- Fork: true (archdx/zerolog-sentry)
- Created: 2023-10-02T14:38:58.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-01-15T09:42:13.000Z (over 2 years ago)
- Last Synced: 2024-03-26T19:23:00.002Z (about 2 years ago)
- Language: Go
- Homepage:
- Size: 63.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zerolog-sentry
[](https://github.com/archdx/zerolog-sentry/actions)
[](https://codecov.io/gh/archdx/zerolog-sentry)
### Example
```go
import (
"errors"
stdlog "log"
"os"
"github.com/archdx/zerolog-sentry"
"github.com/rs/zerolog"
)
func main() {
w, err := zlogsentry.New("http://e35657dcf4fb4d7c98a1c0b8a9125088@localhost:9000/2", zlogsentry.WithEnvironment("dev"), zlogsentry.WithRelease("1.0.0"))
if err != nil {
stdlog.Fatal(err)
}
defer w.Close()
multi := zerolog.MultiLevelWriter(os.Stdout, w)
logger := zerolog.New(multi).With().Timestamp().Logger()
logger.Error().Err(errors.New("dial timeout")).Msg("test message")
}
```