Skip to content

Commit 1aa8bf6

Browse files
authored
Merge pull request #758 from Chia-Network/include-log-level-rpcs
Include log level rpcs
2 parents 947f9a5 + 6c7a54d commit 1aa8bf6

File tree

1 file changed

+163
-0
lines changed

1 file changed

+163
-0
lines changed

docs/rpc-reference/rpc.md

+163
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ TLS certificates are used to secure the communication.
1818
- Harvester: 8560
1919
- Wallet: 9256
2020
- DataLayer: 8562
21+
- Crawler: 8561
22+
- Timelord: 8557
2123

2224
### HTTP/JSON
2325

@@ -181,3 +183,164 @@ Each service is composed of a managed object, an API for control, and an RPC API
181183
- **Managed Objects**: This column details the core entities or components that each service oversees.
182184
- **Associated API**: This column specifies the API class associated with each service. This API class defines the interface for interacting with the corresponding managed objects.
183185
- **Associated RPC API**: This column lists the RPC API class associated with each service. This RPC API class allows for remote control of the managed objects through Remote Procedure Calls (RPC).
186+
187+
## Log Levels
188+
189+
Added in version 2.5.1, the below RPCs are for interacting with log levels for the various services while they are running running.
190+
191+
### `get_log_level`
192+
193+
Functionality: Get the services current log level
194+
195+
Usage: chia rpc [SERVICE] get_log_level
196+
197+
Options:
198+
199+
| Short Command | Long Command | Type | Required | Description |
200+
| :------------ | :----------- | :--- | :------- | :------------------------------------------------------------------ |
201+
| -j | --json-file | TEXT | False | Instead of REQUEST, provide a json file containing the request data |
202+
| -h | --help | None | False | Show a help message and exit |
203+
204+
Request Services:
205+
206+
| Type | Required | Description |
207+
| :----- | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------ |
208+
| STRING | True | The service to query for its log level; valid examples include: "crawler", "data_layer", "farmer", "full_node", "harvester", "timelord", "wallet" |
209+
210+
Request Parameters: None
211+
212+
<details>
213+
<summary>Example</summary>
214+
215+
```json
216+
chia rpc wallet get_log_level
217+
```
218+
219+
Response:
220+
221+
```json
222+
{
223+
"available_levels": [
224+
"CRITICAL",
225+
"FATAL",
226+
"ERROR",
227+
"WARN",
228+
"WARNING",
229+
"INFO",
230+
"DEBUG",
231+
"NOTSET"
232+
],
233+
"level": "WARNING",
234+
"success": true
235+
}
236+
```
237+
238+
</details>
239+
240+
### `set_log_level`
241+
242+
Functionality: Set the services current log level
243+
244+
Usage: chia rpc [SERVICE] set_log_level
245+
246+
Options:
247+
248+
| Short Command | Long Command | Type | Required | Description |
249+
| :------------ | :----------- | :--- | :------- | :------------------------------------------------------------------ |
250+
| -j | --json-file | TEXT | False | Instead of REQUEST, provide a json file containing the request data |
251+
| -h | --help | None | False | Show a help message and exit |
252+
253+
Request Services:
254+
255+
| Type | Required | Description |
256+
| :----- | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------- |
257+
| STRING | True | Set the log level for this service; valid examples include: "crawler", "data_layer", "farmer", "full_node", "harvester", "timelord", "wallet" |
258+
259+
Request Parameters:
260+
261+
| Flag | Type | Required | Description |
262+
| :---- | :----- | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------- |
263+
| level | STRING | True | The log level to set for the designated service; valid levels are: "CRITICAL", "FATAL", "ERROR", "WARN", "WARNING", "INFO", "DEBUG", "NOTSET" |
264+
265+
<details>
266+
<summary>Example</summary>
267+
268+
```json
269+
chia rpc wallet set_log_level '
270+
{
271+
"level": "DEBUG"
272+
}'
273+
274+
```
275+
276+
Response:
277+
278+
```json
279+
{
280+
"available_levels": [
281+
"CRITICAL",
282+
"FATAL",
283+
"ERROR",
284+
"WARN",
285+
"WARNING",
286+
"INFO",
287+
"DEBUG",
288+
"NOTSET"
289+
],
290+
"errors": [],
291+
"level": "DEBUG",
292+
"success": true
293+
}
294+
```
295+
296+
</details>
297+
298+
### `reset_log_level`
299+
300+
Functionality: Reset the services current log level
301+
302+
Usage: chia rpc [SERVICE] reset_log_level
303+
304+
Options:
305+
306+
| Short Command | Long Command | Type | Required | Description |
307+
| :------------ | :----------- | :--- | :------- | :------------------------------------------------------------------ |
308+
| -j | --json-file | TEXT | False | Instead of REQUEST, provide a json file containing the request data |
309+
| -h | --help | None | False | Show a help message and exit |
310+
311+
Request Services:
312+
313+
| Type | Required | Description |
314+
| :----- | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------- |
315+
| STRING | True | Reset the log level for this service; valid examples include: "crawler", "data_layer", "farmer", "full_node", "harvester", "timelord", "wallet" |
316+
317+
Request Parameters: None
318+
319+
<details>
320+
<summary>Example</summary>
321+
322+
```json
323+
chia rpc wallet reset_log_level
324+
```
325+
326+
Response:
327+
328+
```json
329+
{
330+
"available_levels": [
331+
"CRITICAL",
332+
"FATAL",
333+
"ERROR",
334+
"WARN",
335+
"WARNING",
336+
"INFO",
337+
"DEBUG",
338+
"NOTSET"
339+
],
340+
"errors": [],
341+
"level": "WARNING",
342+
"success": true
343+
}
344+
```
345+
346+
</details>

0 commit comments

Comments
 (0)