Update logging.md

replace `--log-stdout` with -`-log-format`. remove references to `--log-file`
This commit is contained in:
sacha 2021-11-09 15:21:48 +01:00 committed by GitHub
parent 66d60e47ae
commit 87fa67045f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 13 deletions

View File

@ -29,13 +29,13 @@ NONE
## Change logging style
Nimbus supports 3 styles of logging: `colors`, `nocolors` and `json`. In `auto` mode, logs will be printed using either `colors` or `nocolors`.
Nimbus supports three log formats: `colors`, `nocolors` and `json`. In `auto` mode, logs will be printed using either `colors` or `nocolors`.
You can choose a log style with the `--log-stdout` option, which also understands `auto` and `none`:
You can choose a log format with the `--log-format` option, which also understands `auto` and `none`:
```
./run-mainnet-beacon-node.sh --log-stdout=none # disable logging to std out
./run-mainnet-beacon-node.sh --log-stdout=json # print json logs, one line per item
./run-mainnet-beacon-node.sh --log-format=none # disable logging to std out
./run-mainnet-beacon-node.sh --log-format=json # print json logs, one line per item
```
## Logging to a file
@ -44,15 +44,7 @@ To send logs to a file, you can redirect the stdout logs:
```
# log json to filename.jsonl
./run-mainnet-beacon-node.sh --log-stdout=json > filename.jsonl
./run-mainnet-beacon-node.sh --log-format=json > filename.jsonl
```
We recommend keeping an eye on the growth of this file with a [log rotator](./log-rotate.md). Logs are written in the "JSON Lines" format - one `json` entry per line.
Nimbus also supports writing logs to a log file using the `--log-file` option - this is provided for historical reasons and may be removed in future releases.
```
./run-mainnet-beacon-node.sh --log-file=filename.jsonl # write json logs to the given filename
```
When the `--log-file` option is enabled, stdout logs will by default be disabled. You can enable them with the `--log-stdout` option (choose any format other than `auto`).