gin middleware for logrus
Go to file
Stéphane Depierrepont fd3afab50f Merge pull request #1 from 9to6/master
fix mistype
2017-07-02 19:29:39 +02:00
.gitignore Initial commit 2016-09-26 13:53:39 +02:00
LICENSE Initial commit 2016-09-26 13:53:39 +02:00
README.md add doc 2016-09-26 16:24:27 +02:00
logger.go fix mistype 2017-06-23 20:37:48 +09:00

README.md

gin-logrus

Logrus logger middleware for Gin

golang gin middleware logrus logger

Usage

import (
  "github.com/Sirupsen/logrus"
  "github.com/toorop/gin-logrus"
  "github.com/gin-gonic/gin"

log := logrus.New()
// hooks, config,...

r := gin.New()
r.Use(ginlogrus.Logger(log), gin.Recovery())

// pingpong
r.GET("/ping", func(c *gin.Context) {
	c.Data(200, "text/plain", []byte("pong"))
})

r.Run("127.0.0.1:8080")