Honour runs_on_no_log in should_run_callback instead of sniffing class names

This commit is contained in:
MOHIT PRASANTH KALAHASTHI 2026-08-06 22:24:18 +05:30
parent 18a4031dfc
commit 30caa9e4e1

View file

@ -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