Skip to main content

View and stream task logs

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.
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:

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​