Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved client logs #167

Merged
merged 2 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions redis/src/aio/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use std::net::{IpAddr, SocketAddr};
use std::pin::Pin;
#[cfg(any(feature = "tokio-comp", feature = "async-std-comp"))]
use tokio_util::codec::Decoder;
use tracing::info;

/// Represents a stateful redis TCP connection.
#[deprecated(note = "aio::Connection is deprecated. Use aio::MultiplexedConnection instead.")]
Expand Down Expand Up @@ -451,6 +452,7 @@ pub(crate) async fn connect_simple<T: RedisRuntime>(
ConnectionAddr::Tcp(ref host, port) => {
let socket_addrs = get_socket_addrs(host, port).await?;
select_ok(socket_addrs.map(|socket_addr| {
info!("IP of node {:?} is {:?}", host, socket_addr.ip());
Box::pin(async move {
Ok::<_, RedisError>((
<T>::connect_tcp(socket_addr).await?,
Expand All @@ -477,6 +479,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| {
info!("IP of node {:?} is {:?}", host, socket_addr.ip());
barshaul marked this conversation as resolved.
Show resolved Hide resolved
Box::pin(async move {
Ok::<_, RedisError>((
<T>::connect_tcp_tls(host, socket_addr, insecure, tls_params).await?,
Expand Down
3 changes: 2 additions & 1 deletion redis/src/cluster_async/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,8 @@ impl<C> Future for Request<C> {
.into();
}
};
trace!("Request error `{}` on node `{:?}", err, address);

warn!("Received request error {} on node {:?}.", err, address);

match err.retry_method() {
crate::types::RetryMethod::AskRedirect => {
Expand Down