> ## Documentation Index
> Fetch the complete documentation index at: https://dify-6c0370d8-agent-add-ai-credits-doc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Logs

> Browse and inspect your app's conversation and run logs, and configure log retention

In the **Logs** tab of any app, see how it is actually used: what people asked or submitted, how the app responded, and what feedback came back.

Chat-based apps (Chatbot, Chatflow, Agent) and Text Generator apps log conversations; Workflow apps log runs.

## What Gets Logged

Logs capture real usage from every channel: the web app, the API, and apps opened from the **WEB APPS** list on **Home**. For Workflow apps, runs started by [triggers](/en/self-host/use-dify/nodes/trigger/overview) are logged too.

End-user feedback (thumbs up/down and comments) is stored with the messages it refers to.

Test sessions from the app editor are excluded for Chatflow and Workflow apps (**Preview** and **Test Run**). For other app types they are listed, under the team member's account.

## Browse Logs

Each row is one conversation or one run. Most columns explain themselves, but a few deserve context:

* **Title** is generated from the conversation's first message.
* **End User or Account** shows a session ID for web app and API usage, or the team member's account for usage inside Dify.
* **User Rate** counts end users' likes and dislikes; **Op. Rate** (operator rate) counts your team's. Both aggregate across the whole conversation.
* **Trigger By** (Workflow apps) shows what started each run:
  * **WebApp**: The published web app, or a call through the API
  * **Webhook**: A webhook trigger receiving a request
  * **Schedule**: A schedule trigger reaching its scheduled time
  * **Integration**: An event from a connected integration

To find a conversation, search words from its messages or the end user's session ID. To find a workflow run, search its inputs or outputs, or paste the run ID.

## Inspect a Conversation

Click a row to open the full message thread. When you hover over an answer, you can:

* See its token spend and latency.
* Open the log behind it: the raw prompt, an Agent app's tool iterations, or a Chatflow message's node-by-node trace.
* Rate the answer as team feedback; a dislike can carry a comment explaining what went wrong. Team ratings fill the **Op. Rate** column, separate from end-user feedback.
* Add an annotation pairing the question with an improved reply. See [Annotation System](/en/self-host/use-dify/monitor/annotation-reply) for how annotated replies take effect.

To share a log entry with a teammate, copy its link in your browser's address bar.

## Inspect a Run

For Workflow apps, click a run to open its result, its inputs and outputs with status and token totals, and a node-by-node trace that pinpoints where a run failed or slowed down.

To reproduce an issue, click **Test With Params**: the workflow re-runs in the editor with this run's inputs.

<Frame>
  <img src="https://mintcdn.com/dify-6c0370d8-agent-add-ai-credits-doc/tKGHQh2gaDiQGTtD/images/use-dify/workflow/test-with-params.png?fit=max&auto=format&n=tKGHQh2gaDiQGTtD&q=85&s=531cd4ba4d3837bcdeb500b5ea3e15a6" alt="Test With Params" width="2070" height="518" data-path="images/use-dify/workflow/test-with-params.png" />
</Frame>

## Log Retention

<Warning>
  Logs contain complete user conversations and may include sensitive information. Ensure your application complies with local data privacy regulations: publish a privacy policy and obtain user consent where required.

  Deleting conversations or cleaning up old logs does not erase the files uploaded in them.
</Warning>

Logs are retained indefinitely by default. To clean up old logs on a schedule:

* **Workflow run logs**: set `WORKFLOW_LOG_CLEANUP_ENABLED` to `true`, and `WORKFLOW_LOG_RETENTION_DAYS` to the number of days to keep (default 30). See [Workflow Log Cleanup](/en/self-host/deploy/configuration/environments#workflow-log-cleanup) for details.
* **Conversation messages**: set `ENABLE_CLEAN_MESSAGES` to `true`, and `SANDBOX_EXPIRED_RECORDS_RETENTION_DAYS` to the number of days to keep (default 30).

Cleanup runs as a scheduled daily task; nothing is deleted the moment you set the variables. Consider shorter retention windows for applications that handle sensitive data.
