Appearance
Telemetry & Logging
All Rust backends initialize tracing via soma_core::telemetry::init_tracing(...) (backend/crates/core/src/telemetry.rs).
Configuration
RUST_LOG: sets the log filter (for example:info,debug,soma_peer=debug,libp2p=info). If unset, each binary supplies a default filter (typicallyinfo).SOMA_LOG_FORMAT: enables structured logging when set tojson(also acceptsstructured,true,1). If unset, logs are formatted as plain text.SOMA_LOGS_DIR: enables file logging when set. Logs are written to a weekly-rotating file with the prefixlogin that directory (the directory is created if missing). If unset, logs go to the default writer (stdout/stderr depending on runtime).SOMA_FLAME_ENABLED: opt-in flame capture usingtracing-flame+tracing-error. When set (1/true/yes/on), a folded stack file is written to aflame/directory that sits next to thelogsdirectory (or./flameifSOMA_LOGS_DIRis unset). One.foldedfile is created per binary (<binary>.folded).
Examples
Plain text to stdout/stderr:
bash
RUST_LOG=info cargo run -p soma-daemon -- --helpJSON to stdout/stderr:
bash
SOMA_LOG_FORMAT=json RUST_LOG=debug cargo run -p soma-daemon -- --helpJSON to a rolling file:
bash
SOMA_LOGS_DIR=./.data/logs/daemon SOMA_LOG_FORMAT=json RUST_LOG=debug \
cargo run -p soma-daemon -- --helpFlame capture alongside logs:
bash
SOMA_FLAME_ENABLED=1 SOMA_LOGS_DIR=./.data/logs/daemon RUST_LOG=info \
cargo run -p soma-daemon -- --help
# Convert folded stacks to an SVG flamegraph (requires inferno)
cat ./.data/flame/soma-daemon.folded | inferno-flamegraph > ./.data/flame/soma-daemon.svg