Suppress /health request logging from localhost
This commit is contained in:
parent
62a1c99841
commit
8f51a2c72d
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue