Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

fix(logger): use specified log level only for first-party crates (#4356)

akshay-97b204be0e919d
diff --git a/crates/router_env/src/logger/setup.rs b/crates/router_env/src/logger/setup.rs
index 4f82c29f5a..af77991e80 100644
--- a/crates/router_env/src/logger/setup.rs
+++ b/crates/router_env/src/logger/setup.rs
@@ -348,14 +348,18 @@ fn get_envfilter(
workspace_members
.drain()
- .zip(std::iter::repeat(filter_log_level.into_level().into()))
+ .zip(std::iter::repeat(filter_log_level.into_level()))
.fold(
EnvFilter::default().add_directive(default_log_level.into_level().into()),
- |env_filter, (_target, directive)| {
+ |env_filter, (target, level)| {
// Safety: This is a hardcoded basic filtering directive. If even the basic
// filter is wrong, it's better to panic.
#[allow(clippy::expect_used)]
- env_filter.add_directive(directive)
+ env_filter.add_directive(
+ format!("{target}={level}")
+ .parse()
+ .expect("Invalid EnvFilter directive format"),
+ )
},
)
})