diff --git a/Cargo.lock b/Cargo.lock index 9632f0d6e..e098cb83d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3961,6 +3961,7 @@ dependencies = [ "tokio-util", "tracing", "tracing-appender", + "tracing-log", "tracing-subscriber", ] diff --git a/bin/rundler/Cargo.toml b/bin/rundler/Cargo.toml index 999612d6f..7f807cb40 100644 --- a/bin/rundler/Cargo.toml +++ b/bin/rundler/Cargo.toml @@ -39,4 +39,5 @@ tokio-rustls = "0.24.1" tokio-util = "0.7.8" tracing.workspace = true tracing-appender = "0.2.2" +tracing-log = "0.1.3" tracing-subscriber = { version = "0.3.16", features = ["env-filter", "fmt", "json"] } diff --git a/bin/rundler/src/cli/tracing.rs b/bin/rundler/src/cli/tracing.rs index 204e29514..e884c7c5c 100644 --- a/bin/rundler/src/cli/tracing.rs +++ b/bin/rundler/src/cli/tracing.rs @@ -16,6 +16,7 @@ use std::io; pub use tracing::*; use tracing::{subscriber, subscriber::Interest, Metadata, Subscriber}; use tracing_appender::non_blocking::WorkerGuard; +use tracing_log::LogTracer; use tracing_subscriber::{layer::SubscriberExt, EnvFilter, FmtSubscriber, Layer}; use super::LogsArgs; @@ -46,6 +47,9 @@ pub fn configure_logging(config: &LogsArgs) -> anyhow::Result { )?; } + // Redirect logs from external crates using `log` to the tracing subscriber + LogTracer::init()?; + Ok(guard) }