easonlin404 / gin-zerolog

Gin middleware for Logging with zerolog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gin-Zerolog

Gin middleware for Logging with zerolog.

Travis branch Codecov branch Go Report Card GoDoc

Usage

Start using it

Download and install it:

$ go get github.com/easonlin404/gin-zerolog

Import it in your code:

import "github.com/easonlin404/gin-zerolog"

Canonical example:

package main

import (
	"github.com/easonlin404/gin-zerolog"
	"github.com/gin-gonic/gin"
)

func main() {

    r := gin.Default()
    r.Use(ginzerolog.Logger())

    r.GET("/", func(c *gin.Context) {
    	// your code
    })

    r.Run()
}

About

Gin middleware for Logging with zerolog

License:MIT License


Languages

Language:Go 100.0%