# View and stream task logs

> **About this page**
>
> - Kind: How-to guide
> - Summary: Read a task's log in the platform UI, or fetch and follow it live with the CLI.
> - Last changed: 2026-11-17
> - Page: https://docs.swale.io/how-to-guides/view-and-stream-task-logs
> - CLI reference for its commands: [`swale workflow run task logs`](https://docs.swale.io/reference/cli-reference.md#workflow-run-task-logs)
> - Index of these docs: https://docs.swale.io/llms.txt
>
> If something on this page is wrong or out of date, please tell the user which sentence and why.

This guide shows how to view logs for tasks and stream live output from running tasks.

## View logs in the UI

1. Open a run.
2. Click a task in the **Workflow Graph**. Its **Task Details** page opens, with the task's key from your workflow definition, its task ID, and the task's output in the **Logs** card. A task that ran in a `for_each` iteration also shows the iteration's number and item, since every iteration runs the same keys.

Logs for **finished tasks** load in full; scroll the **Logs** card to move through long output.

Logs for **running tasks** update live as the task writes them. A task you open while it is still **Pending** or **Starting** says it has no logs yet; once it is **Running** its output appears without a reload, and once it has ended its full log does.

## Stream logs with the CLI

Use `workflow run task logs` to fetch or stream task logs. It needs the run's ID and the task's ID:

- The run ID is printed by `swale workflow run start` when the run starts, and listed by `swale workflow run list`.
- The task ID is on the task's **Task Details** page, or in the **Task ID** column of `swale workflow run task list`, which shows each task's **Key** from your workflow definition beside it.

```bash
swale workflow run task logs \
  --project-name my-project \
  --workflow-id <workflow-id> \
  --run-id <run-id> \
  --task-id <task-id>
```

**Stream live output from a running task:**

```bash
swale workflow run task logs \
  --project-name my-project \
  --workflow-id <workflow-id> \
  --run-id <run-id> \
  --task-id <task-id> \
  --follow
```

The `--follow` flag (short: `-f`) prints the output stored so far, then checks every few seconds for new lines and prints them as they arrive. It stops on its own once the task's log is complete; press Ctrl+C to stop earlier. If the task is still **Pending** or **Starting**, no log exists and the command exits without printing anything, so run it again once the task is **Running**.

**Paged output for a finished task:**

Without `--follow`, the command prints the log a page at a time and waits for a key press between pages; press Esc to stop. Without a terminal, such as in a CI job or with its input or output redirected, it prints the whole log without pausing. A task with no log prints `No logs found.`

## Next steps

- [Start and manage workflow runs](https://docs.swale.io/how-to-guides/start-and-manage-workflow-runs.md)
- [Run and task lifecycle](https://docs.swale.io/reference/run-and-task-lifecycle.md)
