# pw workflows runs logs

> Source: https://parallelworks.com/docs/cli/pw/workflows/runs/logs

## pw workflows runs logs

Fetch workflow run logs

### Synopsis

Fetch step logs from a workflow run. By default shows all steps; use filters to narrow output.

A step's log rotates when it reaches 10 MiB: its earlier output moves to logs.out.1 and only that
one backup is kept, so at most the last 10 to 20 MiB of a step's output is retained. This command
shows the current log only. To read the output from before the latest rotation, fetch
logs/<job>/step_<n>/logs.out.1 with GET /api/workflow-runs/<slug>/files?file=<path>.

```
pw workflows runs logs <slug> [flags]
```

### Examples

```
  # Show all logs for a run
  pw workflows runs logs swift-falcon-17
  
  # Show only failed step logs
  pw workflows runs logs --failed swift-falcon-17
  
  # Show logs for a specific job and step
  pw workflows runs logs --job build --step run-tests swift-falcon-17
  
  # Show last 50 lines per step
  pw workflows runs logs --tail 50 swift-falcon-17
  
  # Follow logs until run completes
  pw workflows runs logs -f swift-falcon-17
  
  # Output as JSON
  pw workflows runs logs -o json swift-falcon-17
  
  # Show the run-level executor log (useful when a step fails before producing its own log)
  pw workflows runs logs --run-level swift-falcon-17
```

### Options

```
      --failed          Only show logs from failed/errored steps
  -f, --follow          Poll and stream new lines until run completes
  -h, --help            help for logs
      --job string      Filter to a specific job name
  -o, --output string   Output format (json)
      --run-level       Fetch the run-level executor log (logs.out) instead of per-step logs
      --step string     Filter to a specific step by name or index number (requires --job)
      --tail int        Last N lines per step (0 = all)
```

### Options inherited from parent commands

```
      --context string         The context to use. Overrides PW_CONTEXT environment variable and current context from config.
      --platform-host string   The Parallel Works ACTIVATE platform host to use. Overrides PW_PLATFORM_HOST environment variable and the current context's server.
  -v, --verbose                Enable verbose logging
```

### SEE ALSO

* [pw workflows runs](/docs/cli/pw/workflows/runs)	 - Manage workflow runs
