From e1273630f93060df58380458be43dd0c87a73cf3 Mon Sep 17 00:00:00 2001 From: Alexsander Hamir Date: Fri, 6 Feb 2026 11:35:25 -0800 Subject: [PATCH] Add INFO-level session reuse logging per request - Log when shared aiohttp session is attached to each request - Log when no shared session is available - Visible at INFO level (production-safe) --- litellm/proxy/route_llm_request.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/litellm/proxy/route_llm_request.py b/litellm/proxy/route_llm_request.py index 92fb88f7147..6baa2047d73 100644 --- a/litellm/proxy/route_llm_request.py +++ b/litellm/proxy/route_llm_request.py @@ -97,10 +97,18 @@ def add_shared_session_to_data(data: dict) -> None: data: Dictionary to add the shared session to """ try: + from litellm._logging import verbose_proxy_logger from litellm.proxy.proxy_server import shared_aiohttp_session if shared_aiohttp_session is not None and not shared_aiohttp_session.closed: data["shared_session"] = shared_aiohttp_session + verbose_proxy_logger.info( + f"SESSION REUSE: Attached shared aiohttp session to request (ID: {id(shared_aiohttp_session)})" + ) + else: + verbose_proxy_logger.info( + "SESSION REUSE: No shared session available for this request" + ) except Exception: # Silently continue without session reuse if import fails or session unavailable pass