# Logs

Everything about PostgreSQL logs.

## 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"}}}}}}
```
