Skip to main content

Overview

LiteLLM provides extensive logging and observability features to track, monitor, and debug LLM requests. Integrate with popular observability platforms or build custom logging solutions.

Basic Logging

Enable Verbose Logging

Environment Variable

Custom Loggers

Basic Custom Logger

Async Custom Logger

Built-in Integrations

LiteLLM integrates with 20+ observability platforms:

Langfuse

DataDog

Prometheus

OpenTelemetry

Other Integrations

Standard Logging Payload

All loggers receive a standardized payload:

Logging Streaming Responses

Database Logging

PostgreSQL Logger

Log Filtering

Selective Logging

Privacy-Preserving Logging

Alerting

Error Alerting

Latency Alerting

Metrics and Analytics

Request Metrics

Best Practices

Logging Best Practices

  1. Use async loggers - Avoid blocking requests
  2. Log selectively - Don’t log everything in production
  3. Protect sensitive data - Use turn_off_message_logging=True
  4. Monitor performance - Track logger latency
  5. Set up alerts - Get notified of failures
  6. Aggregate metrics - Track trends over time
  7. Use structured logging - JSON format for easier parsing

Troubleshooting

Logger Not Called

Missing Metadata

High Logging Latency