Retrieving logs
Use thebranchLogs endpoint to fetch logs for a time range. The endpoint requires the logs:read scope on your API key.
logs array of entries and a nextCursor that you can pass back in a follow-up request to page through additional results.
Request parameters
| Field | Type | Description |
|---|---|---|
start | string (RFC 3339) | Start of the time range. Required. |
end | string (RFC 3339) | End of the time range. Required. |
limit | integer | Maximum number of entries to return. Default 100, maximum 200. |
cursor | string | Pagination cursor returned by a previous response. |
filters | array | Optional filters. Multiple filters are combined with AND. |
Log entry fields
| Field | Description |
|---|---|
timestamp | Time the log was emitted. |
instanceID | Instance that produced the entry (primary or replica). |
level | One of debug, info, warning, error. |
process | Name of the PostgreSQL process that emitted the log. |
message | The log message. |
Filtering
Pass one or morefilters to narrow results. Each filter applies to a specific field with an op and either a value or values:
| Field | Description |
|---|---|
instance | Filter by instance ID. |
level | Filter by log level. |
process | Filter by PostgreSQL process name. |
body | Filter by the log message body. |
in— match any value invalues(use withinstance,level,process).contains/icontains— substring match on the log body (case-sensitive / insensitive).regex/iregex— regular-expression match on the log body.
deadlock:
Pagination
When a response includes a non-nullnextCursor, pass it back as cursor in the next request to fetch the following page. The start, end, limit, and filters should remain the same across paged requests.