From 492ad0c282ba354ff742079d8d7dd88ab250f471 Mon Sep 17 00:00:00 2001 From: Ryan Crabbe Date: Thu, 22 Jan 2026 16:48:28 -0800 Subject: [PATCH] fix: Add safeguard to allow overridden redaction methods to run Check if redact_standard_logging_payload_from_model_call_details was overridden in a subclass before skipping redundant redaction. This ensures custom callbacks with additional redaction logic still execute. --- litellm/integrations/custom_logger.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/litellm/integrations/custom_logger.py b/litellm/integrations/custom_logger.py index 59e3b7a5007..e9e200ff803 100644 --- a/litellm/integrations/custom_logger.py +++ b/litellm/integrations/custom_logger.py @@ -786,9 +786,16 @@ class CustomLogger: # https://docs.litellm.ai/docs/observability/custom_callbac This is useful for logging payloads that contain sensitive information. """ - # skip redundant redaction if global redaction was already applied + # Only skip if global redaction applied AND method is not overridden if global_redaction_applied: - return model_call_details + # Check if this method was overridden in a subclass + method_name = "redact_standard_logging_payload_from_model_call_details" + is_overridden = method_name in type(self).__dict__ + + if not is_overridden: + # Safe to skip - using default implementation + return model_call_details + # Method was overridden - might do additional redaction, so proceed import litellm from copy import copy