Source: LiteLLM docs: callbacks, custom callbacks, proxy logging
How LiteLLM emits logs: string-named integrations via success/failure callbacks, CustomLogger hook classes, the StandardLoggingPayload, OpenTelemetry export, and message-redaction switches on the proxy.
Contents
- What: official documentation pages (“Callbacks”, “Custom Callbacks”, “Proxy - Logging”)
- Publisher: BerriAI (LiteLLM)
- Date: living docs, read 2026-11-14
- Original: observability/callbacks, observability/custom_callback, proxy/logging
Summary
LiteLLM’s logging is a callback system. You either name built-in integrations (Langfuse, OpenTelemetry, Datadog, S3, and many more) or register your own CustomLogger subclass. The proxy configures the same mechanism in litellm_settings and adds per-request controls for redaction and opting out of logging.
Key claims
- SDK:
litellm.input_callback,litellm.success_callback,litellm.failure_callbacktake lists of integration names or functions;litellm.callbackstakesCustomLoggerinstances. CustomLoggerhooks:log_pre_api_call,log_post_api_call,log_success_event,log_failure_event, and asyncasync_log_success_event/async_log_failure_event. Per-deployment hooks (async_pre_call_deployment_hook,async_post_call_success_deployment_hook,async_post_call_failure_deployment_hook) fire once per attempt, including retries and fallbacks.- Proxy-only hooks
async_pre_call_hook(modify the request) andasync_post_call_success_hook(see the caller’s key data, modify the response) do not run in SDK mode. - Callback kwargs carry
response_cost,cache_hitand user metadata; success and failure callbacks getstandard_logging_object(the StandardLoggingPayload), though it can be missing for intermediate streaming events. - Proxy config:
litellm_settings.callbacks/success_callback/failure_callback; a custom logger is referenced by dotted path to an instance. Each response carries anx-litellm-call-idheader. - OpenTelemetry: add
otel, setOTEL_EXPORTER(console,otlp_http,otlp_grpc) andOTEL_ENDPOINT; incomingtraceparentis honoured; forwarding it to providers can break Bedrock and Vertex calls. - Privacy controls:
turn_off_message_loggingdrops prompts and responses but keeps spend metadata;redact_user_api_key_infostrips key identity for some integrations; a request-bodyno-log: trueskips logging unlessglobal_disable_no_log_paramis set. Several destinations (GCS, Azure Blob, per-request callback disabling) need an Enterprise licence. - The S3 logger queues per worker and drops objects after
s3_max_retry_age_seconds(default 3600) or pasts3_max_queue_size(default 50000), so logs can be lost under sustained failures.