Getting started
Read database logs
Read the newest lines of the database's own log, up to 500 (tail, default 100). Passwords and connection-string credentials are removed from every line. A database that is not running has no logs: lines is empty and reason says why.
GET
/api/customer/v1/projects/{projectId}/databases/{databaseId}/logsPath parameters
| Name | Value |
|---|---|
projectId | Required resource ID from an earlier API response. |
databaseId | Required resource ID from an earlier API response. |
Query parameters
| Name | Type | Required | Limits |
|---|---|---|---|
tail | integer | No | Minimum 50; Maximum 500 |
Example request
Set HCODE_BASE_URL and HCODE_API_KEY as shown in Getting started. Replace resource variables with your own IDs.
curl --request GET "$HCODE_BASE_URL/api/customer/v1/projects/${PROJECT_ID}/databases/${DATABASE_ID}/logs" \
--header "Authorization: Bearer $HCODE_API_KEY" Response
The JSON shape is defined in the response schema.
Response schema
{
"type": "object",
"properties": {
"status": {
"type": "string"
},
"serviceRunning": {
"type": "boolean"
},
"lines": {
"type": "array",
"items": {
"type": "object",
"properties": {
"timestamp": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"timestamp",
"message"
],
"additionalProperties": true
}
},
"reason": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"fetchedAt": {
"type": "string"
}
},
"required": [
"status",
"serviceRunning",
"lines"
],
"additionalProperties": true
}See errors and retries for failure responses.