fix(proxy): only wire healthcheck filter in JSON log config when paths configured

Mirror the _suppress_loggers() guard so JSON_LOGS=true users who have not set
LITELLM_DISABLE_ACCESS_LOG_PATHS no longer get unused dictConfig filter machinery
This commit is contained in:
Duck 2026-06-22 22:47:01 +07:00
parent 969a764378
commit 7df0ca6017

View file

@ -399,11 +399,17 @@ def _get_uvicorn_json_log_config():
"()": json_formatter_class, "()": json_formatter_class,
}, },
}, },
"filters": { **(
"healthcheck": { {
"()": "litellm._logging.HealthCheckAccessLogFilter", "filters": {
}, "healthcheck": {
}, "()": "litellm._logging.HealthCheckAccessLogFilter",
},
},
}
if _DISABLED_ACCESS_LOG_PATHS
else {}
),
"handlers": { "handlers": {
"default": { "default": {
"formatter": "json", "formatter": "json",
@ -414,7 +420,7 @@ def _get_uvicorn_json_log_config():
"formatter": "access", "formatter": "access",
"class": "logging.StreamHandler", "class": "logging.StreamHandler",
"stream": "ext://sys.stdout", "stream": "ext://sys.stdout",
"filters": ["healthcheck"], **({"filters": ["healthcheck"]} if _DISABLED_ACCESS_LOG_PATHS else {}),
}, },
}, },
"loggers": { "loggers": {