| Crate |
Type |
First release (approx.) |
Structured fields |
Spans / tracing |
Async-friendly |
Notes |
log
|
Facade (trait only) |
2014 |
No (format strings) |
No |
Basic |
log::info!("user={}", id) — you need a backend like
env_logger or log4rs
|
log4rs
|
Backend for log |
2015 |
Limited |
No |
OK |
Log4j-style YAML/TOML config, appenders, rolling files |
slog
|
Structured logging framework |
2016 |
Yes (key-value) |
No (scopes via Logger) |
OK |
Drains, JSON, async drain; mature but less common in new Tokio apps
|
tracing |
Structured logging + tracing framework |
2019 |
Yes (typed fields) |
Yes (first-class spans) |
Excellent |
Default choice for new async services; OpenTelemetry integration
|