Get Log
Returns log messages from the ring buffer maintained by the MemoryHandler log handler. Returns the most recent count messages, or all messages if count is omitted. Requires admin password.
Request
GET /nxt?requestType=getLog&adminPassword=<adminPassword>&count=<number>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
count | integer | No | Number of log messages to return. Defaults to all messages. Must be >= 0. |
adminPassword | string | Conditional | Admin password required if nxt.adminPassword is set. |
Response
{
"messages": [
"2024-01-01 12:00:00 INFO Starting node",
"2024-01-01 12:00:01 DEBUG Connected to peer 192.168.1.1"
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
messages | array of strings | Array of log message strings. |
Notes
- This endpoint does not require the blockchain to be running (
requireBlockchain = false). - Not chain-specific.
- Requires admin password authentication (
requirePassword = true). - Messages are retrieved from the first
MemoryHandlerfound in the root logger's handlers.
Source: GetLog.java.
Example
curl "http://localhost:22024/nxt?requestType=getLog&count=50"