Logging
This page describes how to configure and operate logging at runtime.
Default Behavior
Section titled “Default Behavior”- Log format: JSON
- Log level:
info - Output: stdout
Environment Variables
Section titled “Environment Variables”RUST_LOG
Section titled “RUST_LOG”Controls log filtering.
Examples:
export RUST_LOG=infoexport RUST_LOG=warn,snakeway=infoexport RUST_LOG=warn,snakeway=debug,pingora=errorIf unset or invalid, logging defaults to:
infoSNAKEWAY_LOG_DIR
Section titled “SNAKEWAY_LOG_DIR”Enables file-based logging with daily rotation.
When set:
- Logs are written to
snakeway.login the specified directory. - Logs rotate daily.
- Output is written to files instead of stdout.
Example:
export SNAKEWAY_LOG_DIR=/var/log/snakewayTOKIO_CONSOLE
Section titled “TOKIO_CONSOLE”Enables Tokio Console mode for interactive debugging.
When set:
- Normal logging is disabled.
- Tokio Console instrumentation is enabled.
- Intended for interactive debugging only.
Example:
export TOKIO_CONSOLE=1This is flag is most useful inline:
TOKIO_CONSOLE=1 snakeway /etc/snakeway/