Skip to content
Skip to Content
Coder Docs

Get logs by workspace agent

GET
/api/v2/workspaceagents/{workspaceagent}/logs

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Path Parameters

workspaceagent*string

Workspace agent ID

Formatuuid

Query Parameters

before?integer

Before log id

after?integer

After log id

follow?boolean

Follow log stream

no_compression?boolean

Disable compression for WebSocket connection

format?string

Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true.

Value in"json""text"

Response Body

OK

application/json
  1. response
[index: integer]?

The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.

curl -X GET \	"$CODER_URL/api/v2/workspaceagents/{workspaceagent}/logs" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN"
Example Response200
[  {    "created_at": "2019-08-24T14:15:22Z",    "id": 0,    "level": "trace",    "output": "string",    "source_id": "ae50a35c-df42-4eff-ba26-f8bc28d2af81"  }]