diff --git a/library/middleware/logger.go b/library/middleware/logger.go index 347b355e..0f02cda9 100644 --- a/library/middleware/logger.go +++ b/library/middleware/logger.go @@ -91,7 +91,9 @@ func LoggerMiddleware(conf gin.LoggerConfig) gin.HandlerFunc { if ok { bodyStr = string(body.([]byte)) } - logger.Info("%s params: %s", formatter(param), bodyStr) + if _, ok := NoLogRoutesMap[param.Path]; !ok { + logger.Info("%s params: %s", formatter(param), bodyStr) + } if strings.Contains(param.Path, "is_there_a_new_version_available") { logger.Info("%s response: %s", formatter(param), blw.body.String()) } @@ -103,3 +105,7 @@ func LoggerMiddleware(conf gin.LoggerConfig) gin.HandlerFunc { } } } + +var NoLogRoutesMap = map[string]bool{ + "/healthcheck": true, +}