From 2cc860f3f692a7d1bd53b611b97786bafc03825a Mon Sep 17 00:00:00 2001 From: Alexsander Hamir Date: Sat, 31 Jan 2026 14:25:08 -0800 Subject: [PATCH] fix: backward compat for CustomLogger.redact_standard_logging_payload_from_model_call_details subclasses --- litellm/litellm_core_utils/litellm_logging.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/litellm/litellm_core_utils/litellm_logging.py b/litellm/litellm_core_utils/litellm_logging.py index 041365e2f70..e5cfa7d4963 100644 --- a/litellm/litellm_core_utils/litellm_logging.py +++ b/litellm/litellm_core_utils/litellm_logging.py @@ -2514,11 +2514,16 @@ class Logging(LiteLLMLoggingBaseClass): if isinstance(callback, CustomLogger): # custom logger class model_call_details: Dict = self.model_call_details ################################## - # call redaction hook for custom logger - model_call_details = callback.redact_standard_logging_payload_from_model_call_details( - model_call_details=model_call_details, - global_redaction_applied=global_redaction_applied, - ) + # call redaction hook for custom logger (backward compat: subclasses may only accept model_call_details) + try: + model_call_details = callback.redact_standard_logging_payload_from_model_call_details( + model_call_details=model_call_details, + global_redaction_applied=global_redaction_applied, + ) + except TypeError: + model_call_details = callback.redact_standard_logging_payload_from_model_call_details( + model_call_details=model_call_details, + ) ################################## if self.stream is True: if "async_complete_streaming_response" in model_call_details: