Filter health check logs from uvicorn access log
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 <noreply@anthropic.com>
This commit is contained in:
parent
8eb0821c9f
commit
7e24c9bd50
1 changed files with 13 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue