---
title: "Get database logs"
method: GET
path: "/spaces/{space_id}/databases/{database_ref}/logs"
---

# Get database logs

`GET /spaces/{space_id}/databases/{database_ref}/logs`

Fetch logs for a specific database. Returns up to 500 log entries in
reverse chronological order. Supports cursor-based pagination via the
`cursor` parameter and the `last_cursor` field in the response.

## Path parameters

- `space_id` string, required
- `database_ref` string, required

## Query parameters

- `cursor` string
- `until` string, date-time
- `since` string, date-time
- `search` string[]
- `severity` string[]

## Response `200`

Database logs

- LogsResponse — A page of database log entries.
  - `entries` LogEntry[], required — Log entries, most recent first.
    - `timestamp` string, date-time, required — Timestamp of the log entry (RFC3339 format, with nanosecond precision)
    - `message` string, required — Log message text
    - `severity` string, required — PostgreSQL severity level (e.g. LOG, WARNING, ERROR, FATAL)
  - `last_cursor` string — Opaque cursor for the next page of results. Present when more log entries exist older than the last entry in this response. Pass this value as the `cursor` query parameter to retrieve the next page. Absent when there are no further results.

## Other responses

- `default` — Error response

---

[API](https://skmtc.net/timescale/apis/ghost-api.md) · [All operations](https://skmtc.net/timescale/apis/ghost-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/timescale/ghost-api/versions/808022f897be/schema)
