Skip to main content
Version: v4

Logging Operations

Operations for reading the standard Harper log (hdb.log). All operations are restricted to super_user roles only.

Audit log and transaction log operations (read_audit_log, read_transaction_log, delete_audit_logs_before, delete_transaction_logs_before) are documented in Database / Transaction Logging.


read_log

Returns log entries from the primary Harper log (hdb.log) matching the provided criteria.

Restricted to super_user roles only.

Parameters

ParameterRequiredTypeDescription
operationYesstringMust be "read_log"
startNonumberResult offset to start from. Default: 0 (first entry in hdb.log).
limitNonumberMaximum number of entries to return. Default: 1000.
levelNostringFilter by log level. One of: notify, error, warn, info, debug, trace. Default: all levels.
fromNostringStart of time window. Format: YYYY-MM-DD or YYYY-MM-DD hh:mm:ss. Default: first entry in log.
untilNostringEnd of time window. Format: YYYY-MM-DD or YYYY-MM-DD hh:mm:ss. Default: last entry in log.
orderNostringSort order: asc or desc by timestamp. Default: maintains hdb.log order.
filterNostringA substring that must appear in each returned log line.

Request

{
"operation": "read_log",
"start": 0,
"limit": 1000,
"level": "error",
"from": "2021-01-25T22:05:27.464+0000",
"until": "2021-01-25T23:05:27.464+0000",
"order": "desc"
}

Response

[
{
"level": "notify",
"message": "Connected to cluster server.",
"timestamp": "2021-01-25T23:03:20.710Z",
"thread": "main/0",
"tags": []
},
{
"level": "warn",
"message": "Login failed",
"timestamp": "2021-01-25T22:24:45.113Z",
"thread": "http/9",
"tags": []
},
{
"level": "error",
"message": "unknown attribute 'name and breed'",
"timestamp": "2021-01-25T22:23:24.167Z",
"thread": "http/9",
"tags": []
}
]

Response Fields

FieldTypeDescription
levelstringLog level of the entry.
messagestringLog message.
timestampstringISO 8601 timestamp when the event occurred.
threadstringThread name and ID (e.g., main/0, http/3).
tagsarrayAdditional context tags. Entries from components may include custom-function or other component tags.