From ac491038b16c77fc7f2249042b35dfb1d58e653d Mon Sep 17 00:00:00 2001 From: Sampras Lopes Date: Tue, 30 Jan 2024 16:25:11 +0530 Subject: [PATCH] fix(logging): add flow to persistent logs fields (#3472) --- crates/router/src/middleware.rs | 5 +++-- crates/router_env/src/logger/storage.rs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/router/src/middleware.rs b/crates/router/src/middleware.rs index 587a15693f..702c3c70e6 100644 --- a/crates/router/src/middleware.rs +++ b/crates/router/src/middleware.rs @@ -58,7 +58,7 @@ where let request_id = request_id_fut.await?; let request_id = request_id.as_hyphenated().to_string(); if let Some(upstream_request_id) = old_x_request_id { - router_env::logger::info!(?request_id, ?upstream_request_id); + router_env::logger::info!(?upstream_request_id); } let mut response = response_fut.await?; response.headers_mut().append( @@ -146,7 +146,8 @@ where "golden_log_line", payment_id = Empty, merchant_id = Empty, - connector_name = Empty + connector_name = Empty, + flow = "UNKNOWN" ) .or_current(), ), diff --git a/crates/router_env/src/logger/storage.rs b/crates/router_env/src/logger/storage.rs index 961a77c65a..036a73cf87 100644 --- a/crates/router_env/src/logger/storage.rs +++ b/crates/router_env/src/logger/storage.rs @@ -92,7 +92,7 @@ impl Visit for Storage<'_> { } } -const PERSISTENT_KEYS: [&str; 3] = ["payment_id", "connector_name", "merchant_id"]; +const PERSISTENT_KEYS: [&str; 4] = ["payment_id", "connector_name", "merchant_id", "flow"]; impl tracing_subscriber::registry::LookupSpan<'a>> Layer for StorageSubscription