fix: reduce log verbosity for /api/operations polling (#8050)

* fix: reduce log verbosity for /api/operations polling

Reduces log clutter by changing the log level from INFO to DEBUG for successful (200 OK) /api/operations requests. This endpoint is polled frequently by the Web UI, causing log spam. Fixes #7989.

* fix: reduce log verbosity for /api/operations polling

Reduces log clutter by changing the log level from INFO to DEBUG for successful (200 OK) /api/operations requests. This endpoint is polled frequently by the Web UI, causing log spam. Fixes #7989.
This commit is contained in:
Divyanshupandey007
2026-01-16 01:43:13 +05:30
committed by GitHub
parent 49d6305509
commit 1a50717e33

View File

@@ -108,7 +108,15 @@ func API(application *application.Application) (*echo.Echo, error) {
req := c.Request()
res := c.Response()
err := next(c)
xlog.Info("HTTP request", "method", req.Method, "path", req.URL.Path, "status", res.Status)
// Fix for #7989: Reduce log verbosity of Web UI polling
// If the path is /api/operations and the request was successful (200),
// we log it at DEBUG level (hidden by default) instead of INFO.
if req.URL.Path == "/api/operations" && res.Status == 200 {
xlog.Debug("HTTP request", "method", req.Method, "path", req.URL.Path, "status", res.Status)
} else {
xlog.Info("HTTP request", "method", req.Method, "path", req.URL.Path, "status", res.Status)
}
return err
}
})