From: Remi Gacogne Date: Thu, 20 Jul 2023 08:07:38 +0000 (+0200) Subject: dnsdist: Better logging of backend server identity X-Git-Tag: rec-5.0.0-alpha1~19^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cc4c7911e862cc768e5f72c81899eb33ae32ba3e;p=thirdparty%2Fpdns.git dnsdist: Better logging of backend server identity --- diff --git a/pdns/dnsdistdist/dnsdist-tcp-downstream.cc b/pdns/dnsdistdist/dnsdist-tcp-downstream.cc index 8dc6cc0a99..35a2befffb 100644 --- a/pdns/dnsdistdist/dnsdist-tcp-downstream.cc +++ b/pdns/dnsdistdist/dnsdist-tcp-downstream.cc @@ -118,7 +118,7 @@ bool ConnectionToBackend::reconnect() return true; } catch (const std::runtime_error& e) { - vinfolog("Connection to downstream server %s failed: %s", d_ds->getName(), e.what()); + vinfolog("Connection to downstream server %s failed: %s", d_ds->getNameWithAddr(), e.what()); d_downstreamFailures++; if (d_downstreamFailures >= d_ds->d_config.d_retries) { throw; @@ -269,7 +269,7 @@ IOState TCPConnectionToBackend::queueNextQuery(std::shared_ptr& conn, const struct timeval& now) { - DEBUGLOG("sending query to backend "<getDS()->getName()<<" over FD "<d_handler->getDescriptor()); + DEBUGLOG("sending query to backend "<getDS()->getNameWithAddr()<<" over FD "<d_handler->getDescriptor()); IOState state = conn->d_handler->tryWrite(conn->d_currentQuery.d_query.d_buffer, conn->d_currentPos, conn->d_currentQuery.d_query.d_buffer.size()); @@ -555,16 +555,16 @@ void TCPConnectionToBackend::handleTimeout(const struct timeval& now, bool write if (write) { if (isFresh() && d_queries == 0) { ++d_ds->tcpConnectTimeouts; - vinfolog("Timeout while connecting to TCP backend %s", d_ds->getName()); + vinfolog("Timeout while connecting to TCP backend %s", d_ds->getNameWithAddr()); } else { ++d_ds->tcpWriteTimeouts; - vinfolog("Timeout while writing to TCP backend %s", d_ds->getName()); + vinfolog("Timeout while writing to TCP backend %s", d_ds->getNameWithAddr()); } } else { ++d_ds->tcpReadTimeouts; - vinfolog("Timeout while reading from TCP backend %s", d_ds->getName()); + vinfolog("Timeout while reading from TCP backend %s", d_ds->getNameWithAddr()); } try {