gin middleware for logrus
Go to file
re bb5e54fbda Update 'logger.go' 2022-12-12 14:51:23 +03: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 Update 'README.md' 2022-12-12 14:35:16 +03:00
logger.go Update 'logger.go' 2022-12-12 14:51:23 +03:00

README.md

gin-logrus

Logrus logger middleware for Gin

golang gin middleware logrus logger

Usage

import (
  "git.internal/re/logrus"
  "git.internal/re/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")