Skip to content

Commit

Permalink
Log fix: Log the host:port when creating a new connection
Browse files Browse the repository at this point in the history
  • Loading branch information
barshaul committed Jul 31, 2024
1 parent 173a9af commit e6635ac
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions redis/src/aio/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ pub(crate) async fn connect_simple<T: RedisRuntime>(
}
let socket_addrs = get_socket_addrs(host, port).await?;
select_ok(socket_addrs.map(|socket_addr| {
log_conn_creation("TCP", host, Some(socket_addr.ip()));
log_conn_creation("TCP", format!("{host}:{port}"), Some(socket_addr.ip()));
Box::pin(async move {
Ok::<_, RedisError>((
<T>::connect_tcp(socket_addr).await?,
Expand All @@ -496,7 +496,11 @@ pub(crate) async fn connect_simple<T: RedisRuntime>(
}
let socket_addrs = get_socket_addrs(host, port).await?;
select_ok(socket_addrs.map(|socket_addr| {
log_conn_creation("TCP with TLS", host, Some(socket_addr.ip()));
log_conn_creation(
"TCP with TLS",
format!("{host}:{port}"),
Some(socket_addr.ip()),
);
Box::pin(async move {
Ok::<_, RedisError>((
<T>::connect_tcp_tls(host, socket_addr, insecure, tls_params).await?,
Expand Down

0 comments on commit e6635ac

Please sign in to comment.