From 9552c6e9e1d20283db9ab295c9bf115cd2124412 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Thu, 15 Jan 2026 05:16:21 -0800 Subject: [PATCH] Allow for RUST_LOG module-level logging settings for tracing --- akd/crates/publisher/Cargo.toml | 2 +- akd/crates/publisher/src/main.rs | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/akd/crates/publisher/Cargo.toml b/akd/crates/publisher/Cargo.toml index b3947c4c80..0d6f7d75fa 100644 --- a/akd/crates/publisher/Cargo.toml +++ b/akd/crates/publisher/Cargo.toml @@ -21,7 +21,7 @@ thiserror = { workspace = true } tokio-util = { version = "0.7.16", features = ["compat"] } tokio = { workspace = true } tracing = { workspace = true } -tracing-subscriber = { workspace = true } +tracing-subscriber = { workspace = true, features = ["env-filter"] } uuid = { workspace = true } async-std = { version = "1.13.2", features = ["attributes"] } subtle = "2.6.1" diff --git a/akd/crates/publisher/src/main.rs b/akd/crates/publisher/src/main.rs index e35370abd5..e3b8f96f92 100644 --- a/akd/crates/publisher/src/main.rs +++ b/akd/crates/publisher/src/main.rs @@ -2,16 +2,20 @@ //! Write permissions are needed to the underlying data stores. //! There should only be one instance of this running at a time for a given AKD. -use publisher::start; use tracing::info; +use tracing::level_filters::LevelFilter; +use tracing_subscriber::EnvFilter; +use publisher::start; use publisher::ApplicationConfig; #[tokio::main] async fn main() -> anyhow::Result<()> { - tracing_subscriber::fmt() - .with_max_level(tracing::Level::TRACE) - .init(); + let env_filter = EnvFilter::builder() + .with_default_directive(LevelFilter::INFO.into()) + .from_env_lossy(); + + tracing_subscriber::fmt().with_env_filter(env_filter).init(); // Load configuration let config = ApplicationConfig::load()