diff --git a/opsqueue/app/main.rs b/opsqueue/app/main.rs index e3cc6d6..010ffa0 100644 --- a/opsqueue/app/main.rs +++ b/opsqueue/app/main.rs @@ -67,7 +67,6 @@ pub async fn async_main() { "Startup of Opsqueue ({}) complete.", opsqueue::version_info() ); - tracing::info!("Listening on {}", &server_addr); tokio::signal::ctrl_c() .await diff --git a/opsqueue/src/server.rs b/opsqueue/src/server.rs index b935963..f983141 100644 --- a/opsqueue/src/server.rs +++ b/opsqueue/src/server.rs @@ -44,7 +44,12 @@ pub async fn serve_producer_and_consumer( prometheus_config.clone(), ); let listener = tokio::net::TcpListener::bind(server_addr).await?; - + match listener.local_addr() { + Ok(addr) => tracing::info!("Server listening on {addr}"), + Err(err) => tracing::warn!( + "Could not get locally bound address of the server, tried binding on {server_addr}: {err}" + ), + } axum::serve(listener, router) .with_graceful_shutdown(cancellation_token.clone().cancelled_owned()) .await?;