diff --git a/Cargo.lock b/Cargo.lock index 363416f..abc2744 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -489,6 +489,7 @@ dependencies = [ "sqlx", "tokio", "tracing", + "tracing-error", "tracing-subscriber", ] diff --git a/Cargo.toml b/Cargo.toml index 8a29572..f21d846 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,4 +21,5 @@ secrecy = "0.8.0" sqlx = { version = "0.7.3", features = ["runtime-tokio", "tls-rustls"] } tokio = { version = "1.36.0", features = ["macros", "rt-multi-thread"] } tracing = "0.1.40" +tracing-error = "0.2.0" tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } diff --git a/src/main.rs b/src/main.rs index c20990a..8efef20 100644 --- a/src/main.rs +++ b/src/main.rs @@ -24,6 +24,7 @@ mod server; use color_eyre::Result; use tracing::{event, instrument, Level}; +use tracing_error::ErrorLayer; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter}; #[instrument] @@ -38,6 +39,7 @@ fn init() -> Result<()> { tracing_subscriber::registry() .with(filter_layer) .with(fmt_layer) + .with(ErrorLayer::default()) .init(); Ok(())