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

# Logs and Metrics

> Read historical logs, follow output, and inspect resource and request metrics

You can inspect your apps through the dashboard, CLI, or MCP.

## Read Logs

`beam logs` returns the last 100 entries. Add `--follow` to stream new output:

```bash theme={null}
beam logs my-api
beam logs my-api --since 30m --tail 200
beam logs my-api --search error --source stderr
beam logs my-api --source system
beam logs my-api --follow --timestamps
```

Use `--source system` to debug image pulls, mounts, and container exits.

A name selects the app's active deployment. Use an ID if multiple versions are active. Target a specific resource with `--deployment-id`, `--stub-id`, `--task-id`, or `--container-id`; use `--app-id` for all versions.

## Time Windows and Output

* `--since` and `--until` accept relative durations (`30m`, `2h`, `1d`) or ISO timestamps. Timestamps without an offset use UTC; `--until` is exclusive.
* `--tail` (also `--lines` or `-n`) accepts 0–1000. Use `--tail 0 --follow` to read only new output.
* `--json` emits one JSON record per line. `--format json` returns a historical JSON response; `--format jsonl` streams records.
* `--until` cannot be combined with `--follow`.

## Dashboard Metrics

Open an app or container to view CPU, memory, GPU, and network metrics. Task details show execution times and exit status.

## MCP Metrics and Logs

| Tool | Use |
| - | - |
| `logs` | Recent logs by app name (all versions), deployment, stub, task, or container; filter with `since_minutes`, `search`, and `stream` |
| `metrics` | Resource time series for an app, deployment, or stub using `window_minutes` and a `1m` or `1h` interval |
| `request_stats` | Endpoint request count, 5xx fraction, and p50/p95/p99 latency |
| `list_tasks`, `get_task` | Invocation state, timings, and container IDs |

`request_stats` supports endpoints. Latency percentiles are histogram upper bounds; resource averages are per container.

Use the [REST API](/v2/reference/platform-api) for custom dashboards or [webhooks](/v2/operations/webhooks) for event notifications.
