Doc: update logging convention

Update the logging convention as capnslog is replaced by zap.
This commit is contained in:
Sahdev Zala 2022-04-21 21:18:32 -04:00
parent e02ac59cfc
commit d4a21b5d17

View File

@ -1,29 +1,33 @@
# Logging Conventions # Logging Conventions
etcd uses the [capnslog][capnslog] library for logging application output categorized into *levels*. A log message's level is determined according to these conventions: etcd uses the [zap][zap] library for logging application output categorized into *levels*. A log message's level is determined according to these conventions:
* Error: Data has been lost, a request has failed for a bad reason, or a required resource has been lost * Debug: Everything is still fine, but even common operations may be logged, and less helpful but more quantity of notices. Usually not used in production.
* Examples: * Examples:
* A failure to allocate disk space for WAL * Send a normal message to a remote peer
* Write a log entry to disk
* Info: Normal, working log information, everything is fine, but helpful notices for auditing or common operations. Should rather not be logged more frequently than once per a few seconds in normal server's operation.
* Examples:
* Startup configuration
* Start to do snapshot
* Warning: (Hopefully) Temporary conditions that may cause errors, but may work fine. A replica disappearing (that may reconnect) is a warning. * Warning: (Hopefully) Temporary conditions that may cause errors, but may work fine. A replica disappearing (that may reconnect) is a warning.
* Examples: * Examples:
* Failure to send raft message to a remote peer * Failure to send raft message to a remote peer
* Failure to receive heartbeat message within the configured election timeout * Failure to receive heartbeat message within the configured election timeout
* Notice: Normal, but important (uncommon) log information. * Error: Data has been lost, a request has failed for a bad reason, or a required resource has been lost.
* Examples: * Examples:
* Add a new node into the cluster * Failure to allocate disk space for WAL
* Add a new user into auth subsystem
* Info: Normal, working log information, everything is fine, but helpful notices for auditing or common operations. * Panic: Unrecoverable or unexpected error situation that requires stopping execution.
* Examples: * Examples:
* Startup configuration * Failure to create the database
* Start to do snapshot
* Debug: Everything is still fine, but even common operations may be logged, and less helpful but more quantity of notices. * Fatal: Unrecoverable or unexpected error situation that requires immediate exit. Mostly used in the test.
* Examples: * Examples:
* Send a normal message to a remote peer * Failure to find the data directory
* Write a log entry to disk * Failure to run a test function
[capnslog]: https://github.com/coreos/pkg/tree/master/capnslog [zap]: https://github.com/uber-go/zap