From 7e24c9bd50918cb4b772473d36166a99d1221ea1 Mon Sep 17 00:00:00 2001 From: michael Date: Fri, 19 Dec 2025 06:37:56 -0600 Subject: [PATCH] Filter health check logs from uvicorn access log MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add HealthCheckFilter to suppress /health endpoint logs at INFO level, reducing noise from Docker healthcheck requests every 30 seconds. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- backend/app/main.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/backend/app/main.py b/backend/app/main.py index 8f291ea..e7c97f3 100755 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -18,6 +18,19 @@ logging.basicConfig( datefmt="%Y-%m-%d %H:%M:%S" ) logger = logging.getLogger(__name__) + + +class HealthCheckFilter(logging.Filter): + """Filter out health check endpoint logs from uvicorn access log.""" + def filter(self, record: logging.LogRecord) -> bool: + message = record.getMessage() + if "GET /health" in message: + return False + return True + + +# Filter out health check logs from uvicorn access log +logging.getLogger("uvicorn.access").addFilter(HealthCheckFilter()) from app.websocket.manager import ConnectionManager from app.websocket.handlers import handle_analyze_message from app.services.gemini_service import GeminiService