Logs

List logs

List logs matching the provided filters. Logs are paginated by start and end timestamps. There are more logs to fetch if hasMore is true in the response. Provide the nextStartTime and nextEndTime timestamps as the startTime and endTime query parameters to fetch the next page of logs.

You can query for logs across multiple resources, but all resources must be in the same region and belong to the same owner.

get/logs

Query parameters

ownerIdstring required

The ID of the workspace to return logs for

startTimestring date-time
Example:2021-06-17T08:15:30Z

Epoch/Unix timestamp of start of time range to return. Defaults to now() - 1 hour.

endTimestring date-time
Example:2021-06-17T08:30:30Z

Epoch/Unix timestamp of end of time range to return. Defaults to now().

direction'forward' | 'backward'

The direction to query logs for. Backward will return most recent logs first. Forward will start with the oldest logs in the time range.

resourcestring[] required

Filter logs by their resource. A resource is the id of a server, cronjob, job, postgres, redis, or workflow.

instancestring[]

Filter logs by the instance they were emitted from. An instance is the id of a specific running server.

hoststring[]

Filter request logs by their host. Wildcards and regex are supported.

statusCodestring[]

Filter request logs by their status code. Wildcards and regex are supported.

methodstring[]

Filter request logs by their requests method. Wildcards and regex are supported.

taskstring[]

Filter logs by their task(s)

taskRunstring[]

Filter logs by their task run id(s)

levelstring[]

Filter logs by their severity level. Wildcards and regex are supported.

typestring[]

Filter logs by their type. Types include app for application logs, request for request logs, and build for build logs. You can find the full set of types available for a query by using the GET /logs/values endpoint.

textstring[]

Filter by the text of the logs. Wildcards and regex are supported.

pathstring[]

Filter request logs by their path. Wildcards and regex are supported.

limitinteger

Defaults to 20

The maximum number of items to return. For details, see Pagination.

Response

A collection of logs with pagination metadata

hasMoreboolean required

True if there are more logs to fetch

nextStartTimestring date-time required

The start time to use in the next query to fetch the next set of logs

nextEndTimestring date-time required

The end time to use in the next query to fetch the next set of logs

logsSchema[] required— unresolved $ref

Changes