Skip to content

Commit 61dc19a

Browse files
authored
chore(api): log /api/v1/healthz requests at debug level instead of info to reduce noise (#481)
* chore(api): log /api/v1/healthz requests at debug level instead of info to reduce noise * chore(api): fix indentation * chore(api): refine to match path prefix and suffix
1 parent d53a1c2 commit 61dc19a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/services/api/logger_middleware.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ func LoggerMiddlewareWithSanitizer(logger *logging.Logger, sanitizer *RequestBod
6060
hub.CaptureException(getErrorWithStackTrace(c.Errors.Last().Err))
6161
}
6262
} else {
63-
logger.Info("request completed", fields...)
63+
if strings.HasPrefix(c.Request.URL.Path, "/api") && strings.HasSuffix(c.Request.URL.Path, "/healthz") {
64+
logger.Debug("healthz request completed", fields...)
65+
} else {
66+
logger.Info("request completed", fields...)
67+
}
6468
}
6569
}
6670
}

0 commit comments

Comments
 (0)