> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/api-reference/databases/postgresql/logs-1/get-logs-of-your-cluster.md).

# Get logs of your cluster

Retrieves PostgreSQL logs based on the given parameters.

```json
{"openapi":"3.0.3","info":{"title":"IONOS DBaaS PostgreSQL REST API","version":"1.0.0"},"tags":[{"name":"Logs","description":"Everything about PostgreSQL logs."}],"servers":[{"url":"https://api.ionos.com/databases/postgresql","description":"Production"}],"security":[{"basicAuth":[]},{"tokenAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"You will need to base64 encode the string containing your credentials.\nSeparate your username and password with a colon, i.e.,\nusername:password and send it as 'Authorization' request header. More\ndetails: https://en.wikipedia.org/wiki/Basic_access_authentication.\n"},"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Please provide header value as 'Bearer <token>' and don't forget to add\n'Bearer' HTTP Authorization Scheme before the token.\n"}},"parameters":{"ClusterIdPath":{"name":"clusterId","in":"path","description":"The unique ID of the cluster.","required":true,"schema":{"type":"string"}}},"schemas":{"ClusterLogs":{"description":"The logs of the PostgreSQL cluster.","properties":{"instances":{"type":"array","items":{"properties":{"name":{"description":"The name of the PostgreSQL instance.","type":"string"},"messages":{"type":"array","items":{"type":"object","properties":{"time":{"type":"string","format":"date-time"},"message":{"type":"string"}}}}},"type":"object"}}},"type":"object"},"ErrorResponse":{"properties":{"httpStatus":{"type":"integer","description":"The HTTP status code of the operation."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ErrorMessage"}}},"type":"object"},"ErrorMessage":{"properties":{"errorCode":{"type":"string","description":"Application internal error code\n"},"message":{"type":"string","description":"A human readable explanation specific to this occurrence of the\nproblem.\n"}},"type":"object"}},"responses":{"ApiError":{"description":"Any erroneous status code: 400 (parse error), 401 (auth error),\n402 (trial access), 403 (insufficient permissions), 404 (not found),\n405 (unsupported HTTP method), 415 (unsupported content type,\n422 (validation error), 429 (request rate limit exceeded),\n500 (server error), 503 (maintenance)\n","headers":{"Content-Type":{"description":"application/problem+json","schema":{"type":"string","default":"application/problem+json"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/clusters/{clusterId}/logs":{"get":{"operationId":"clusterLogsGet","summary":"Get logs of your cluster","description":"Retrieves PostgreSQL logs based on the given parameters.","tags":["Logs"],"parameters":[{"$ref":"#/components/parameters/ClusterIdPath"},{"name":"start","in":"query","description":"The start time for the query in RFC3339 format. Must not be more than 30 days ago but before the end parameter. The default is 30 days ago.","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"end","in":"query","description":"The end time for the query in RFC3339 format. Must not be greater than now. The default is the current timestamp.","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"direction","in":"query","description":"The direction in which to scan through the logs. The logs are returned in order of the direction.","schema":{"type":"string","default":"BACKWARD","enum":["BACKWARD","FORWARD"]}},{"name":"limit","in":"query","description":"The maximal number of log lines to return.  If the limit is reached then log lines will be cut at the end (respecting the scan direction).","required":false,"schema":{"type":"integer","default":100,"minimum":1,"maximum":5000}}],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClusterLogs"}}}},"default":{"$ref":"#/components/responses/ApiError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ionos.com/cloud/api-reference/databases/postgresql/logs-1/get-logs-of-your-cluster.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
