From 30caa9e4e1450b904c1ecdf6ba22bdc501452557 Mon Sep 17 00:00:00 2001 From: MOHIT PRASANTH KALAHASTHI <22170424+mohitprasanth@users.noreply.github.com> Date: Thu, 6 Aug 2026 22:24:18 +0530 Subject: [PATCH] Honour runs_on_no_log in should_run_callback instead of sniffing class names --- litellm/litellm_core_utils/litellm_logging.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/litellm/litellm_core_utils/litellm_logging.py b/litellm/litellm_core_utils/litellm_logging.py index 9475441e214..af0faf9200d 100644 --- a/litellm/litellm_core_utils/litellm_logging.py +++ b/litellm/litellm_core_utils/litellm_logging.py @@ -1669,7 +1669,21 @@ class Logging(LiteLLMLoggingBaseClass): if litellm_params.get("no-log", False) is True: # proxy cost tracking cal backs should run - if not (isinstance(callback, CustomLogger) and "_PROXY_" in callback.__class__.__name__): + if not ( + + isinstance(callback, CustomLogger) + + and ( + + callback.runs_on_no_log + + # Retained for callbacks predating `runs_on_no_log`. + + or "_PROXY_" in callback.__class__.__name__ + + ) + + ): verbose_logger.debug("no-log request, skipping logging for %s event", event_hook) return False