Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions docs/Reference/API-Methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,29 @@ Adds a [static node](../HowTo/Find-and-Connect/Managing-Peers.md#static-nodes).

### admin_changeLogLevel

Change the log level without restarting Besu.
Changes the log level without restarting Besu. You can change the log level for all logs, or you can change the log level for specific packages or classes.

Only one log level can be specified per RPC call.

**Parameters**

`level` - [Log level](CLI/CLI-Syntax.md#logging)

`log_filter`: `Array` - Packages or classes to change the log level for. Optional.

**Returns**

`result` : `Success` if the log level has changed; otherwise `error`.

This example changes the debug level for specified classes to `DEBUG`.

!!! example
```bash tab="curl HTTP request"
curl -X POST --data '{"jsonrpc":"2.0","method":"admin_changeLogLevel","params":["DEBUG"], "id":1}' http://127.0.0.1:8545
curl -X POST --data '{"jsonrpc":"2.0", "method":"admin_changeLogLevel", "params":["DEBUG", ["tech.pegasys.pantheon.ethereum.eth.manager","tech.pegasys.pantheon.ethereum.p2p.rlpx.connections.netty.ApiHandler"]], "id":1}' http://127.0.0.1:8545
Comment thread
bgravenorst marked this conversation as resolved.
```

```bash tab="wscat WS request"
{"jsonrpc":"2.0","method":"admin_changeLogLevel","params":["DEBUG"], "id":1}
{"jsonrpc":"2.0", "method":"admin_changeLogLevel", "params":["DEBUG", ["tech.pegasys.pantheon.ethereum.eth.manager","tech.pegasys.pantheon.ethereum.p2p.rlpx.connections.netty.ApiHandler"]], "id":1}
```

```json tab="JSON result"
Expand All @@ -77,7 +83,25 @@ Change the log level without restarting Besu.
"result": "Success"
}
```
This example changes the debug level of all logs to `WARN`.

!!! example
```bash tab="curl HTTP request"
curl -X POST --data '{"jsonrpc":"2.0","method":"admin_changeLogLevel","params":["WARN"], "id":1}' http://127.0.0.1:8545
```

```bash tab="wscat WS request"
{"jsonrpc":"2.0","method":"admin_changeLogLevel","params":["WARN"], "id":1}
```

```json tab="JSON result"
{
"jsonrpc": "2.0",
"id": 1,
"result": "Success"
}
```

### admin_nodeInfo

Returns networking information about the node. The information includes general information about the node
Expand Down