Categorygithub.com/qor/log
modulepackage
0.0.0-20180202015346-3606b757e8e4
Repository: https://github.com/qor/log.git
Documentation: pkg.go.dev

# README

Logger

A logger middleware for Gin

GoDoc

Usage

import "github.com/qor/log"

func main() {
  router := gin.New()
  router.Use(log.Logger("application.log", 30)) // save logs into application.log, max days is 30
}

License

Released under the MIT License.

# Functions

Logger is a middleware that will write the logs to gin.DefaultWriter By default gin.DefaultWriter = os.Stdout.
LoggerWithHide is a middleware that will hide the values of the given headers when logging Must specify all headers, password is not default here Default writer is used.
LoggerWithWriter is a middleware with the specified writer buffer.