> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squarecloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Read app logs from the CLI

> Print the latest logs of a Square Cloud application with squarecloud app logs, or follow its output and status changes live in the terminal with app realtime.

`[appID]` is optional: see [how the CLI finds your app](/en/cli-reference/quickstart#how-the-cli-finds-your-app).

## `squarecloud app logs`

```bash Usage theme={"system"}
squarecloud app logs [appID] [--json]
```

Prints the most recent logs of the application and exits.

```bash theme={"system"}
squarecloud app logs
# Logs of the app in the ID= line, or pick one.
```

```bash theme={"system"}
squarecloud app logs <appID> --json
# Prints {"logs": "..."} instead of plain text.
```

## `squarecloud app realtime`

```bash Usage theme={"system"}
squarecloud app realtime [appID]
```

Connects to the application's live stream and stays connected until you press `Ctrl+C`.

* Log lines are printed as the application wrote them. Lines the application wrote to stderr go to stderr, so you can separate them with a redirect.
* The status appears as `[status] <state>` only when it changes.

```bash theme={"system"}
squarecloud app realtime <appID> 2> errors.log
# Follows the app live and saves its stderr lines to errors.log.
```

```bash Output theme={"system"}
Connected to the realtime stream of <appID> (Ctrl+C to exit)
[status] running
<log lines>
```

`realtime` has no JSON output.

## Related

| Command | API | JavaScript SDK | VS Code |
| - | - | - | - |
| `logs` | [`GET .../logs`](/en/api-reference/endpoint/apps/logs) | [`api.apps.logs()`](/en/sdks/js/managing_application) | [Show logs](/en/vscode-extension/features#applications) |
| `realtime` | [`GET .../realtime`](/en/api-reference/endpoint/apps/realtime) | [`api.apps.realtime()`](/en/sdks/js/realtime) | [Toggle realtime stream](/en/vscode-extension/features#applications) |

For edge request logs of a website, see [`squarecloud app network logs`](/en/cli-reference/edge-analytics#squarecloud-app-network-logs).
