chore: add /mcp/health filter and configure uvicorn.access logging
Add /mcp/health to suppress paths in log_filters.py to demote health probe logs to DEBUG level. Configure uvicorn.access logger in settings.py to manage access logs directly instead of relying on mcp_server internal filters. Update comments to reflect that uvicorn access is now managed in project settings.
This commit is contained in:
@@ -20,6 +20,7 @@ _SUPPRESS_PATHS = frozenset(
|
|||||||
"/ready",
|
"/ready",
|
||||||
"/healthz",
|
"/healthz",
|
||||||
"/metrics",
|
"/metrics",
|
||||||
|
"/mcp/health",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -389,8 +389,7 @@ LOGGING = {
|
|||||||
"filters": {
|
"filters": {
|
||||||
# Demotes successful health-probe access log lines from INFO to
|
# Demotes successful health-probe access log lines from INFO to
|
||||||
# DEBUG so production INFO output stays signal-only. Applied to
|
# DEBUG so production INFO output stays signal-only. Applied to
|
||||||
# django.server and gunicorn.access; uvicorn does its own thing
|
# django.server, gunicorn.access, and uvicorn.access.
|
||||||
# via the structlog-style filter in mcp_server.
|
|
||||||
"suppress_health_access": {
|
"suppress_health_access": {
|
||||||
"()": "mnemosyne.log_filters.SuppressHealthAccessFilter",
|
"()": "mnemosyne.log_filters.SuppressHealthAccessFilter",
|
||||||
},
|
},
|
||||||
@@ -458,6 +457,11 @@ LOGGING = {
|
|||||||
"level": DJANGO_LOGGING_LEVEL,
|
"level": DJANGO_LOGGING_LEVEL,
|
||||||
"propagate": False,
|
"propagate": False,
|
||||||
},
|
},
|
||||||
|
"uvicorn.access": {
|
||||||
|
"handlers": ["access"],
|
||||||
|
"level": LOGGING_LEVEL,
|
||||||
|
"propagate": False,
|
||||||
|
},
|
||||||
# Noisy library internals — pin to WARNING regardless of root level
|
# Noisy library internals — pin to WARNING regardless of root level
|
||||||
# so we don't drown in HTTP-client debug spam when LOGGING_LEVEL=DEBUG.
|
# so we don't drown in HTTP-client debug spam when LOGGING_LEVEL=DEBUG.
|
||||||
"httpx": {"handlers": ["console"], "level": "WARNING", "propagate": False},
|
"httpx": {"handlers": ["console"], "level": "WARNING", "propagate": False},
|
||||||
|
|||||||
Reference in New Issue
Block a user