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.
Where data can end up
| Place | What it holds | Content by default |
|---|---|---|
| Spend logs in the gateway database | One row per request: key, user, team, model, tokens, cost, time | No. Only when prompt storage is switched on |
| Logging callbacks such as Langfuse or a storage bucket | Whatever the callback sends | Yes, once a callback is configured |
| OpenTelemetry traces | Spans with timing, model and token counts | No in the current integration. Content is opt-in |
| Container logs | Errors, and full requests when debug logging is on | No, 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
| Setting | Effect |
|---|---|
| turn_off_message_logging: True | Prompts and answers are left out of every callback. Tokens, cost and metadata are still recorded |
| redact_user_api_key_info: true | Key hash, user ID and team ID are removed from what goes to Langfuse, OpenTelemetry, Logfire and Arize |
| store_prompts_in_spend_logs | Off 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_period | Deletes spend log rows older than the period you set |
| global_disable_no_log_param: True | Callers can no longer switch logging off for a single request |
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.
Related services
LiteLLM gateway
Budgets and access rules for every team's AI use, through a LiteLLM gateway that is hardened, connected to your identity provider and kept up to date.
AI platform for all teams
One approved route to AI for every team, with budgets, logs and a free choice of model, run on your servers or in your cloud.
More from the blog
Works council and AI logs
Which fields in the logs of an AI assistant, an LLM gateway or a coding agent make monitoring possible under German co-determination law, and how to set up logging so a works agreement holds.
AI trace data retention
What to log to debug agents without keeping every sensitive prompt: three tiers of trace data, content capture off by default, the limits of redaction and retention set by your policy owners.
Running LiteLLM in production
What a production LiteLLM gateway consists of, how to size it, which settings differ from the defaults, how database connections add up, and what happens when the database is down.
Guardrails at the LLM gateway
LiteLLM ships with almost every protective control switched off. Which ones to turn on first, how a guardrail is defined, what it costs in latency, and what a guardrail cannot protect you from.
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
Founder and CEO of Cloudsail
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.
Look for the draft in your email program
Send it from there, and Mickey replies in person with times for a 30-minute call. If no draft has opened, write to us at miki@cloudsail.com.