Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: about 1 month ago
JSON representation

Replace the log output of gin with zap

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))
```