Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/winking324/rzap-gin
Replace the log output of gin with zap
https://github.com/winking324/rzap-gin
gin log lumberjack zap
Last synced: 19 days ago
JSON representation
Replace the log output of gin with zap
- Host: GitHub
- URL: https://github.com/winking324/rzap-gin
- Owner: winking324
- License: mit
- Created: 2022-01-13T03:02:23.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-13T06:10:21.000Z (almost 3 years ago)
- Last Synced: 2024-10-16T19:01:21.098Z (2 months ago)
- Topics: gin, log, lumberjack, zap
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rzap-gin
Replace the log output of gin with zap
## How to install
`go get github.com/winking324/rzap-gin`
## How to use
``` go
rzap.NewGlobalLogger([]zapcore.Core{
rzap.NewCore(&lumberjack.Logger{
Filename: "/your/log/path/app.log",
}, zap.InfoLevel),
})r := gin.New()
r.Use(rzap_gin.Logger(nil), rzap_gin.Recovery(nil, false))
```