ginzerolog

package module
v0.0.0-...-8001804 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2019 License: MIT Imports: 4 Imported by: 1

README

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()
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger() gin.HandlerFunc

Logger function is gin middleware to use zerolog

func LoggerWithWriter

func LoggerWithWriter(out io.Writer) gin.HandlerFunc

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL