# Build and deploy logs

Source: https://openpanel.sh/docs/monitoring/build-logs

The build and deploy logs kept with each deployment.

Every deployment keeps two logs with it, so you can read them even while its servers are offline:

- **Build**: the output of building a service from Git (an image deployment has none).
- **Deploy**: one line for each thing a server reported while rolling it out: the image pulled, a container started, healthy or unhealthy, stopped.

Each log keeps its first 2 MiB. A longer build also keeps its last 200 lines, after a line that says how many were left out. The logs go when the deployment is deleted with its service or project.

## Read them [#read-them]

The current deployment's logs, from the CLI. Without `--deployment`, `openpanel logs` reads the service's [runtime logs](/docs/monitoring/logs), and falls back to these when runtime logs are not set up:

```sh
openpanel logs --deployment "$DEPLOYMENT_ID"
openpanel logs --deployment "$DEPLOYMENT_ID" --tail 50   # the last 50 lines of each log
openpanel logs --deployment "$DEPLOYMENT_ID" --follow    # until the deployment runs or fails
```

From the API:

```sh
curl "https://openpanel.sh/api/v1/deployments/$DEPLOYMENT_ID/logs?tail=200" \
  -H "Authorization: Bearer $OPENPANEL_TOKEN"
```

```json
{
  "deploymentId": "0193b7a0-…",
  "build": { "text": "#1 [internal] load build definition from Dockerfile\n…", "lines": 412, "bytes": 30211, "dropped": 0, "updatedAt": "2026-12-01T18:02:11.000Z" },
  "deploy": { "text": "2026-12-01 18:02:14  image.pulled         op-0193b7a0-…-0\n…", "lines": 4, "bytes": 260, "dropped": 0, "updatedAt": "2026-12-01T18:02:20.000Z" }
}
```

A log that has not started yet is `null`. From an AI agent, the MCP tool is `deployments_logs`.

Anyone who can see the project can read its deployments' logs. The console does not show them yet.