BlogSecurity

LiteLLM logging: what is stored and how to limit it

Out of the box LiteLLM sends prompts and answers to no logging tool. It records one row per request in its own database with the key, team, model, token counts and cost. Content is stored only where you configure it: in a callback to a tool such as Langfuse or an OpenTelemetry collector, or in the spend logs if prompt storage is switched on. Since every request in the company passes through the gateway, this is worth deciding before the first team connects. As of 27 November 2026.

By Updated

Where data can end up

Places where a LiteLLM gateway can store request data, from LiteLLM's logging documentation, checked on 27 November 2026
PlaceWhat it holdsContent by default
Spend logs in the gateway databaseOne row per request: key, user, team, model, tokens, cost, timeNo. Only when prompt storage is switched on
Logging callbacks such as Langfuse or a storage bucketWhatever the callback sendsYes, once a callback is configured
OpenTelemetry tracesSpans with timing, model and token countsNo in the current integration. Content is opt-in
Container logsErrors, and full requests when debug logging is onNo, as long as debug stays off

The model provider is a separate question. What Azure, AWS or Anthropic keep is governed by your contract with them and not by any gateway setting.

The switches

LiteLLM settings that control what is logged, from LiteLLM's logging documentation, checked on 27 November 2026
SettingEffect
turn_off_message_logging: TruePrompts and answers are left out of every callback. Tokens, cost and metadata are still recorded
redact_user_api_key_info: trueKey hash, user ID and team ID are removed from what goes to Langfuse, OpenTelemetry, Logfire and Arize
store_prompts_in_spend_logsOff by default. When on, prompts and answers are written to the gateway database. The admin UI has the same switch and it overrides the config file
maximum_spend_logs_retention_periodDeletes spend log rows older than the period you set
global_disable_no_log_param: TrueCallers can no longer switch logging off for a single request
Gateway configuration that keeps message content out of logs
litellm_settings:
  turn_off_message_logging: True
  redact_user_api_key_info: true
  json_logs: true
  set_verbose: False

general_settings:
  store_prompts_in_spend_logs: false
  maximum_spend_logs_retention_period: "90d"

The 90 days in the example are a placeholder. The right period is the one your data protection officer and works council agree to.

Who can override the settings

A rule about logging is only worth something if you know who can get around it. LiteLLM has three ways.

  • A caller can send no-log: true with a request and that request is not logged at all. That is useful for a team with sensitive data and awkward for an audit trail. The global setting above removes the option.
  • When redaction is on, a caller can ask for an exception with a header. The gateway honours it only for keys and teams that an administrator has explicitly allowed.
  • An administrator can give a team its own logging destination or switch logging off for that team. This is how one team's traces go to its own Langfuse project while another team's content is stored nowhere.

Switching off individual callbacks for a single request is an Enterprise feature. The rest of this page works in the open-source version.

What to settle before the first team connects

  • Whether prompt content is stored at all, and if so for which teams and in which system.
  • How long spend logs are kept. They contain no content, but they show who used which model and when, and in Germany that makes them a works council topic.
  • Who can read them. The admin UI shows usage per user, so admin rights are access to personal data.
  • Whether the same answers hold for the observability tool behind the gateway. It has its own retention and its own user list.

LiteLLM's production checklist says to keep message storage off for sensitive workloads and to set retention for each store. We would start with content logging off everywhere and switch it on for the teams that need traces to debug their application, in a project only they can read.

Questions

Does LiteLLM store prompts?

Not by default. Prompts are stored when you configure a logging callback or switch on prompt storage in the spend logs. Setting turn_off_message_logging keeps content out of callbacks while cost tracking continues.

Can I track cost per team without logging content?

Yes. Spend tracking uses token counts and metadata. It does not need the text of prompts or answers.

How long does LiteLLM keep spend logs?

Until you delete them, unless you set maximum_spend_logs_retention_period. With that setting the gateway removes older rows itself.

Talk to an engineer

Bring one piece of work you would like to improve. The call takes 30 minutes and needs no access to your systems or your data.

Booking runs on Google Calendar.

Mickey Graf

Mickey Graf

Founder and CEO of Cloudsail

Rated 4.9 out of 5 on Clutch

Prefer to write first? Leave your email and a few lines. Mickey reads every message himself and replies by email with times for a call.

The button prepares an email in your own email program, for you to send. Privacy policy (draft)