curl --request POST \
  --url http://localhost:3000/api/v1/mirrors/logs \
  --header 'Authorization: Basic something==' \
  --header 'Content-Type: application/json' \
  --data '{
  "level": "error",
  "flowJobName": "",
  "beforeId": -1,
  "afterId": -1,
  "numPerPage": 2,
  "page": 0
}
'
{
	"errors": [
		{
			"flowName": "mirror_development",
			"errorMessage": "failed to push data to ClickHouse: table users does not exist",
			"errorType": "error",
			"errorTimestamp": 1748972135285,
			"id": 702169
		},
		{
			"flowName": "mirror_staging",
			"errorMessage": "failed to connect to Postgres",
			"errorType": "error",
			"errorTimestamp": 1748972135047,
			"id": 702168
		}
	],
	"total": 63,
	"page": 1
}
POST /v1/mirrors/logs
This endpoint is used to get logs of a mirror (even one which has been deleted) or all mirrors. A mirror represents a data movement pipeline between two peers.

Request Fields

flow_job_name
string
The name of the mirror to get logs for. An empty string will return logs for all mirrors in the PeerDB instance.
level
string
The log level to filter logs by. Can be one of ALL, INFO, WARN, or ERROR. Defaults to ALL.
page
number
The page number to retrieve.
num_per_page
number
The number of logs to retrieve per page. If set to 0 or unset, no logs will be returned and a total count of logs will be returned.
before_id
number
The ID of the last log to retrieve logs before.
after_id
number
The ID of the first log to retrieve logs after.

Response Fields

errors
array
An array of logs. The name is misleading here - it can contain info and warns as well, not just errors.
total
number
The total number of logs available.
page
number
The current page number.
curl --request POST \
  --url http://localhost:3000/api/v1/mirrors/logs \
  --header 'Authorization: Basic something==' \
  --header 'Content-Type: application/json' \
  --data '{
  "level": "error",
  "flowJobName": "",
  "beforeId": -1,
  "afterId": -1,
  "numPerPage": 2,
  "page": 0
}
'
{
	"errors": [
		{
			"flowName": "mirror_development",
			"errorMessage": "failed to push data to ClickHouse: table users does not exist",
			"errorType": "error",
			"errorTimestamp": 1748972135285,
			"id": 702169
		},
		{
			"flowName": "mirror_staging",
			"errorMessage": "failed to connect to Postgres",
			"errorType": "error",
			"errorTimestamp": 1748972135047,
			"id": 702168
		}
	],
	"total": 63,
	"page": 1
}