Add logging notes for geth docs: add logging notes for geth

This document provides an overview of logging options for geth, including verbosity levels, log output, and common patterns. Added a doc describing logging levels and working with logs.
This commit is contained in:
patridunk 2025-12-17 14:23:31 +01:00 committed by GitHub
parent 6978ab48aa
commit 8ee49ddeda
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

33
docs/LOGGING_NOTES.md Normal file
View file

@ -0,0 +1,33 @@
# Logging Notes
This document provides a short overview of logging-related options
for geth.
## Verbosity levels
The `--verbosity` flag controls how much information geth prints:
- `0` silent (only fatal errors),
- `1` errors,
- `2` warnings,
- `3` info (default for many setups),
- `4` debug,
- `5` trace (very verbose).
Use higher verbosity levels only when debugging, as they can generate
large amounts of log data.
## Log output
To direct logs to a file instead of stdout, use shell redirection, for example:
geth ... --verbosity 3 >> geth.log 2>&1
Consider log rotation tools (such as `logrotate` or container log
rotation) for long-running nodes.
## Common patterns
- Keep default verbosity in production unless debugging a specific issue.
- When reporting a bug, include logs with a short time window around
the problematic event at a reasonably high verbosity (34).