Skip to content

Commit d6f4617

Browse files
gautamg795Convex, Inc.
authored and
Convex, Inc.
committed
use ResolvedHost to print site id in http logs (#28507)
GitOrigin-RevId: 4df3c79cb257990a72fb8c6132c51c23ae4086ba
1 parent dce2cbd commit d6f4617

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/common/src/http/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,10 +1009,11 @@ where
10091009

10101010
async fn log_middleware<B: Send>(
10111011
remote_addr: Option<axum::extract::ConnectInfo<SocketAddr>>,
1012+
ExtractResolvedHost(resolved_host): ExtractResolvedHost,
10121013
req: http::request::Request<B>,
10131014
next: axum::middleware::Next<B>,
10141015
) -> Result<impl IntoResponse, HttpResponseError> {
1015-
let site_id = ::std::env::var("CONVEX_SITE").unwrap_or_default();
1016+
let site_id = resolved_host.instance_name;
10161017
let start = Instant::now();
10171018

10181019
let remote_addr = remote_addr.map(|connect_info| connect_info.0);

0 commit comments

Comments
 (0)