modulepackage
0.0.0-20200807034502-6711eff2eb9a
Repository: https://github.com/chandraanwar91/gin-logger.git
Documentation: pkg.go.dev
# README
logger
Gin middleware/handler to logger url path using rs/zerolog.
Example:
package main
import (
"github.com/chandraanwar91/logger"
"github.com/gin-gonic/gin"
)
func main() {
//setting confing
config := logger.Config{
SkipPath: []string{"/application/health"}, // if we want to skip log
SkipLoggedPathResponse: []string{"/application/get-credential"}, //if we don't want to log body response
}
r := gin.New()
// Add a logger middleware, which:
// - Logs all requests, like a combined access and error log.
// - Logs to stdout.
r.Use(logger.SetLogger(config))
// Listen and Server in 0.0.0.0:8080
r.Run(":8080")
}
# Packages
No description provided by the author
# Functions
No description provided by the author
No description provided by the author
SetLogger initializes the logging middleware.
# Constants
Headers.
# Variables
DefaultLoggerConfig is the default Logger middleware config.