Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

use redact_message_input_output_from_custom_logger

Ishaan Jaff12d8c0d0a408
diff --git a/litellm/litellm_core_utils/litellm_logging.py b/litellm/litellm_core_utils/litellm_logging.py
index f57dd3b8123..b1db82a775d 100644
--- a/litellm/litellm_core_utils/litellm_logging.py
+++ b/litellm/litellm_core_utils/litellm_logging.py
@@ -28,6 +28,7 @@ from litellm.cost_calculator import _select_model_name_for_cost_calc
from litellm.integrations.custom_guardrail import CustomGuardrail
from litellm.integrations.custom_logger import CustomLogger
from litellm.litellm_core_utils.redact_messages import (
+ redact_message_input_output_from_custom_logger,
redact_message_input_output_from_logging,
)
from litellm.rerank_api.types import RerankResponse
@@ -1395,6 +1396,9 @@ class Logging:
call_type=self.call_type,
)
elif isinstance(callback, CustomLogger):
+ result = redact_message_input_output_from_custom_logger(
+ result=result, litellm_logging_obj=self, custom_logger=callback
+ )
self.model_call_details, result = await callback.async_logging_hook(
kwargs=self.model_call_details,
result=result,