Skip to main content

Set Logging

Sets the node's log level and peer communication logging settings. Requires admin password. This is a POST-only endpoint.

Request​

POST /nxt?requestType=setLogging&adminPassword=<adminPassword>&logLevel=<level>&communicationLogging=<mask>

Parameters​

NameTypeRequiredDescription
logLevelstringNoLog level: DEBUG, INFO, WARN, or ERROR. Defaults to INFO if not specified.
communicationLoggingintegerNoBit mask for peer communication logging: 1 = log network message names, 2 = log network message details. Defaults to 0 (no communication logging).
adminPasswordstringConditionalAdmin password required if nxt.adminPassword is set.

Response​

{
"loggingUpdated": true
}

Response Fields​

FieldTypeDescription
loggingUpdatedbooleantrue if the logging was successfully updated.

Error Responses​

ConditionResponse
Invalid log level{"error": "logLevel", "errorDescription": "Incorrect logLevel, logLevel must be DEBUG, INFO, WARN or ERROR"}

Notes​

  • This endpoint does not require the blockchain to be running (requireBlockchain = false).
  • Not chain-specific.
  • Requires admin password authentication (requirePassword = true).
  • Requires POST method (requirePost = true).

Source: SetLogging.java.

Example​

curl -X POST "http://localhost:22024/nxt" \
-d "requestType=setLogging" \
-d "adminPassword=mySecretPassword" \
-d "logLevel=DEBUG" \
-d "communicationLogging=3"