gin-contrib / logger

Gin middleware/handler to logger url path using rs/zerolog
MIT License
192 stars 35 forks source link

feat(option): add WithPathLevel option #72

Closed goodevilgenius closed 9 months ago

goodevilgenius commented 11 months ago

Resolves #71

The following can now be done:

r := gin.New()
r.Use(logger.SetLogger(
    logger.WithPathLevel(map[string]zerolog.Level{"/health": zerolog.DebugLevel}),
)

Any successful requests to /health would result in a debug level log, instead of the default info level.