# Logs

Each app has two logs: the runtime log of the running app, and the deploy log of each build.

## Read the logs

```
astris logs <app-id>
```

- `--source runtime` or `--source deploy` selects the log. Without `--source`, you get the runtime log.
- `--tail <n>` sets how many lines, at most 500. Without it, you get 100 lines.
- `--deployment <n>` sets which deploy to read, 1 to 5, where 1 is the newest. It needs `--source deploy`.

The MCP tool `logs` takes the same choices: `app_id`, `source`, `tail` and `deployment`.

## Ask why a deploy failed

```
astris diagnose --app <id>
```

The MCP tool `diagnose` does the same. It explains a failed deploy, an exit code or an app that ran out of memory, and says what to do next.
