Skip to content
Skip to Content

Read a service's logs

GET
/services/{serviceId}/logs

The newest lines its running containers wrote, read live from each server through its agent and merged by time. Logs stay on the servers, so a server whose agent is away is listed in unreachable instead.

Authorization

bearer
headerAuthorizationBearer <token>

An API key (opk_…) or a CLI token (opc_…).

Path parameters

serviceId*string

The service's id.

Query parameters

tail?integer

How many lines, 1 to 1000. Default 100.

Range1 <= value <= 1000

Response body

Read a service's logs

application/json
  1. response
data*array<>

The newest lines of every replica, merged by time, oldest first.

unreachable*array<>

Containers whose server's agent could not be asked; their lines are missing.

Example request
curl "https://openpanel.sh/api/v1/services/$SERVICE_ID/logs" \  -H "Authorization: Bearer $OPENPANEL_TOKEN"
Example response
{  "data": [    {      "at": "2019-08-24T14:15:22Z",      "serverId": "10d2345a-e43d-463d-830e-4f5b19b60d41",      "container": "string",      "replica": 0,      "line": "string"    }  ],  "unreachable": [    {      "serverId": "10d2345a-e43d-463d-830e-4f5b19b60d41",      "container": "string",      "reason": "string"    }  ]}