Alternatives
Recipe | Crates | Categories |
---|---|---|
Older alternatives to tracing | ||
log | ||
slog | ||
log4rs | ||
env_logger | ||
Other frameworks | ||
OpenTelemetry | ||
OpenObserve |
TODO
Older alternatives to tracing
Tracing is now the "go-to" crate for logging.
log
log
is an older and simpler crate if your needs are simple and you are not using any async code.
slog
Structured, extensible, composable logging.
slog
remains a stable, featureful and battle-tested library, used in many important projects.
log4rs
A highly configurable multi-output logging implementation for the log facade.
use log::{error, info, warn}; use log4rs; fn main() { log4rs::init_file("config/log4rs.yaml", Default::default()).unwrap(); info!("booting up"); // ... }
env_logger
A logging implementation for log which is configured via an environment variable. env_logger
makes sense when used in executables (binary projects). Libraries should use the log crate instead.
use log::info; fn main() { env_logger::init(); info!("starting up"); // ... }
Other frameworks
OpenTelemetry
OpenTelemetry Rust documentation⮳
OpenObserve
openobserve⮳ (written in Rust) is a petabyte-scale Elasticsearch/Splunk/Datadog alternative for logs, metrics, traces, RUM, error tracking, and session replay.
TODO write / organize together with the old log content?
incorporate into SUMMARY, etc