# Group Long Command Logs (https://www.shipfox.io/docs/how-to/author-workflows/group-command-logs)

Description: Print log markers around command output so the run view renders collapsible groups.

Use groups when one command step produces a long stream that is hard to scan.

## Add the workflow [#add-the-workflow]

Create `.shipfox/workflows/grouped-logs.yml`. This complete workflow groups
output from two example commands. Replace the commands between the markers with
your own.

```yaml
# yaml-language-server: $schema=https://www.shipfox.io/docs/workflow.schema.json
name: Group command logs
runner: shipfox

triggers:
  manual:
    source: manual

jobs:
  example:
    steps:
      - run: |
          echo "::group::First command"
          echo "First line"
          echo "Second line"
          echo "::endgroup::"

          echo "::group::Second command"
          echo "Third line"
          echo "Fourth line"
          echo "::endgroup::"
```

Commit and push the file to the project's default branch. Wait for **Group
command logs** to sync.

## Verify the groups [#verify-the-groups]

Start the workflow and open the command step.

1. Confirm that **First command** and **Second command** appear as separate
   collapsible groups.
2. Open each group and confirm that it contains only its command's output.

Use [Inspect logs](https://www.shipfox.io/docs/how-to/run-and-troubleshoot/inspect-logs) when output is
missing, delayed, or truncated. Exact group and log limits live in
[Limits](https://www.shipfox.io/docs/reference/limits#logs).