Skip to content

Commit

Permalink
Suppress /health request logging from localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
tessus committed May 24, 2023
1 parent 62a1c99 commit 8f51a2c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions router/router.go
Expand Up @@ -176,6 +176,10 @@ func Create(db *database.GormDatabase, vInfo *model.VersionInfo, conf *config.Co
var tokenRegexp = regexp.MustCompile("token=[^&]+")

func logFormatter(param gin.LogFormatterParams) string {
if (param.ClientIP == "127.0.0.1" || param.ClientIP == "::1") && param.Path == "/health" {
return ""
}

var statusColor, methodColor, resetColor string
if param.IsOutputColor() {
statusColor = param.StatusCodeColor()
Expand Down

0 comments on commit 8f51a2c

Please sign in to comment.