core-lightning/doc/schemas/lightning-getlog.json
Rusty Russell b327bd30c3 doc: fix all JSON schemas to enforce no additional properties.
Without this, we have hardly any enforcement.  This is why the schema
mistake fixed in the previous patches weren't spotted immediately.

The hard work was done by:

```
$ for f in lightning-*.json; do grep -v '^  "additionalProperties": false,' $f | bagto $f; done
$ for f in lightning-*.json; do sed 's/"properties": {/"additionalProperties": false, "properties": {/' $f | bagto $f; done
$ make fmt-schemas
```

Then checking where 'additionalProperties: true' had been turned to
false (we deliberately use it in some places where there are if
statements in the schema, or occasionally where there can be arbitrary
fields).

[Including doc/rpc-schema-draft.json update by Shahana]
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-10-30 15:39:12 +10:30

298 lines
8.1 KiB
JSON

{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"rpc": "getlog",
"title": "Command to show logs.",
"description": [
"The **getlog** the RPC command to show logs, with optional log *level*."
],
"categories": [
"readonly"
],
"request": {
"required": [],
"additionalProperties": false,
"properties": {
"level": {
"type": "string",
"enum": [
"broken",
"unusual",
"info",
"debug",
"trace",
"io"
],
"description": [
"A string that represents the log level."
],
"default": "*info*"
}
}
},
"response": {
"required": [
"created_at",
"bytes_used",
"bytes_max",
"log"
],
"additionalProperties": false,
"properties": {
"created_at": {
"type": "string",
"description": [
"UNIX timestamp with 9 decimal places, when logging was initialized."
]
},
"bytes_used": {
"type": "u32",
"description": [
"The number of bytes used by logging records."
]
},
"bytes_max": {
"type": "u32",
"description": [
"The bytes_used values at which records will be trimmed ."
]
},
"log": {
"type": "array",
"items": {
"type": "object",
"required": [
"type"
],
"additionalProperties": true,
"properties": {
"type": {
"type": "string",
"enum": [
"SKIPPED",
"BROKEN",
"UNUSUAL",
"INFO",
"DEBUG",
"TRACE",
"IO_IN",
"IO_OUT"
]
}
},
"allOf": [
{
"if": {
"additionalProperties": true,
"properties": {
"type": {
"enum": [
"SKIPPED"
]
}
}
},
"then": {
"additionalProperties": false,
"required": [
"num_skipped"
],
"properties": {
"type": {},
"num_skipped": {
"type": "u32",
"description": [
"Number of unprinted log entries (deleted or below *level* parameter)."
]
}
}
}
},
{
"if": {
"additionalProperties": true,
"properties": {
"type": {
"enum": [
"BROKEN",
"UNUSUAL",
"INFO",
"DEBUG",
"TRACE"
]
}
}
},
"then": {
"additionalProperties": false,
"required": [
"time",
"source",
"log"
],
"properties": {
"type": {},
"time": {
"type": "string",
"description": [
"UNIX timestamp with 9 decimal places after **created_at**."
]
},
"source": {
"type": "string",
"description": [
"The particular logbook this was found in."
]
},
"log": {
"type": "string",
"description": [
"The actual log message."
]
},
"node_id": {
"type": "pubkey",
"description": [
"The peer this is associated with."
]
}
}
}
},
{
"if": {
"additionalProperties": true,
"properties": {
"type": {
"enum": [
"IO_IN",
"IO_OUT"
]
}
}
},
"then": {
"additionalProperties": false,
"required": [
"time",
"source",
"log",
"data"
],
"properties": {
"type": {},
"time": {
"type": "string",
"description": [
"Seconds after **created_at**, with 9 decimal places."
]
},
"source": {
"type": "string",
"description": [
"The particular logbook this was found in."
]
},
"log": {
"type": "string",
"description": [
"The associated log message."
]
},
"node_id": {
"type": "pubkey",
"description": [
"The peer this is associated with."
]
},
"data": {
"type": "hex",
"description": [
"The IO which occurred."
]
}
}
}
}
]
}
}
}
},
"errors": [
"On failure, one of the following error codes may be returned:",
"",
"- -32602: Error in given parameters."
],
"author": [
"Vincenzo Palazzo <<vincenzo.palazzo@protonmail.com>> wrote the initial version of this man page,",
"but many others did the hard work of actually implementing this rpc command."
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:getlog#1",
"method": "getlog",
"params": {
"level": "unusual"
}
},
"response": {
"created_at": "1722303623.956237697",
"bytes_used": 1723719,
"bytes_max": 10485760,
"log": [
{
"type": "SKIPPED",
"num_skipped": 2927
},
{
"type": "UNUSUAL",
"time": "59.598510878",
"node_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
"source": "chan#1",
"log": "No peer channel with scid=6250403x3681116x19863"
},
{
"type": "SKIPPED",
"num_skipped": 1183
},
{
"type": "UNUSUAL",
"time": "71.923794351",
"node_id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
"source": "chan#2",
"log": "Peer permanent failure in CLOSINGD_COMPLETE: Funding transaction spent (reason=unknown)"
},
{
"type": "SKIPPED",
"num_skipped": 557
},
{
"type": "BROKEN",
"time": "89.108598990",
"source": "plugin-topology",
"log": "DEPRECATED API USED: listchannels.include_private by \\\"-c:listchannels#114/cln:listchannels#175\\\""
},
{
"type": "SKIPPED",
"num_skipped": 1246
},
{
"type": "UNUSUAL",
"time": "95.217065000",
"source": "plugin-cln-renepay",
"log": "Failed to update hint channel 111x1x0: Failed to update scid=111x1x0 in the local_gossmods."
},
{
"type": "SKIPPED",
"num_skipped": 1696
}
]
}
}
]
}