Saltearse al contenido

Avoid logging query strings

Esta página aún no está disponible en tu idioma.

Use the SkipQueryString option in LoggerConfig to prevent query strings from appearing in logs. For example, /path?q=1 will be logged as /path.

func main() {
router := gin.New()
// SkipQueryString indicates that the logger should not log the query string.
// For example, /path?q=1 will be logged as /path
loggerConfig := gin.LoggerConfig{SkipQueryString: true}
router.Use(gin.LoggerWithConfig(loggerConfig))
}