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
| Name | Type | Required | Description |
|---|---|---|---|
logLevel | string | No | Log level: DEBUG, INFO, WARN, or ERROR. Defaults to INFO if not specified. |
communicationLogging | integer | No | Bit mask for peer communication logging: 1 = log network message names, 2 = log network message details. Defaults to 0 (no communication logging). |
adminPassword | string | Conditional | Admin password required if nxt.adminPassword is set. |
Response
{
"loggingUpdated": true
}
Response Fields
| Field | Type | Description |
|---|---|---|
loggingUpdated | boolean | true if the logging was successfully updated. |
Error Responses
| Condition | Response |
|---|---|
| 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"