From 7df0ca6017799bccee8c7fcffbe10ae85a0dc01a Mon Sep 17 00:00:00 2001 From: Duck Date: Mon, 22 Jun 2026 22:47:01 +0700 Subject: [PATCH] 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 --- litellm/_logging.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/litellm/_logging.py b/litellm/_logging.py index 32e04deca8a..109d6653e84 100644 --- a/litellm/_logging.py +++ b/litellm/_logging.py @@ -399,11 +399,17 @@ def _get_uvicorn_json_log_config(): "()": json_formatter_class, }, }, - "filters": { - "healthcheck": { - "()": "litellm._logging.HealthCheckAccessLogFilter", - }, - }, + **( + { + "filters": { + "healthcheck": { + "()": "litellm._logging.HealthCheckAccessLogFilter", + }, + }, + } + if _DISABLED_ACCESS_LOG_PATHS + else {} + ), "handlers": { "default": { "formatter": "json", @@ -414,7 +420,7 @@ def _get_uvicorn_json_log_config(): "formatter": "access", "class": "logging.StreamHandler", "stream": "ext://sys.stdout", - "filters": ["healthcheck"], + **({"filters": ["healthcheck"]} if _DISABLED_ACCESS_LOG_PATHS else {}), }, }, "loggers": {