Skip to content

Commit

Permalink
fix(logging): add an end log line for LogSpanInitializer (#3528)
Browse files Browse the repository at this point in the history
  • Loading branch information
lsampras authored Feb 1, 2024
1 parent 1828ea6 commit 13be7e6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
9 changes: 7 additions & 2 deletions crates/router/src/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,14 @@ where
let response_fut = self.service.call(req);

Box::pin(
response_fut.instrument(
async move {
let response = response_fut.await;
logger::info!(golden_log_line = true);
response
}
.instrument(
router_env::tracing::info_span!(
"golden_log_line",
"ROOT_SPAN",
payment_id = Empty,
merchant_id = Empty,
connector_name = Empty,
Expand Down
4 changes: 2 additions & 2 deletions crates/router/src/routes/customers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ pub async fn get_customer_mandates(
customer_id: path.into_inner(),
};

api::server_wrap(
Box::pin(api::server_wrap(
flow,
state,
&req,
Expand All @@ -166,6 +166,6 @@ pub async fn get_customer_mandates(
req.headers(),
),
api_locking::LockAction::NotApplicable,
)
))
.await
}
4 changes: 2 additions & 2 deletions crates/router/src/routes/mandates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub async fn retrieve_mandates_list(
) -> HttpResponse {
let flow = Flow::MandatesList;
let payload = payload.into_inner();
api::server_wrap(
Box::pin(api::server_wrap(
flow,
state,
&req,
Expand All @@ -132,6 +132,6 @@ pub async fn retrieve_mandates_list(
req.headers(),
),
api_locking::LockAction::NotApplicable,
)
))
.await
}

0 comments on commit 13be7e6

Please sign in to comment.