salvo-logging
Installation
SKILL.md
Salvo Logging and Tracing
[dependencies]
salvo = { version = "0.94.0", features = ["logging"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
Logger middleware
salvo::logging::Logger emits a tracing span per request with remote_addr, version, method, path, and response status + duration. It must be installed on a Service (not a Router) so it wraps the catcher and sees the final status:
use salvo::logging::Logger;
use salvo::prelude::*;