Skip to main content

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

NameTypeRequiredDescription
countintegerNoNumber of log messages to return. Defaults to all messages. Must be >= 0.
adminPasswordstringConditionalAdmin 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

FieldTypeDescription
messagesarray of stringsArray 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 MemoryHandler found in the root logger's handlers.

Source: GetLog.java.

Example

curl "http://localhost:22024/nxt?requestType=getLog&count=50"