]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Make sure not to use logging interfaces not taking priority by mistake.
authorMiod Vallat <miod.vallat@powerdns.com>
Fri, 6 Mar 2026 10:23:19 +0000 (11:23 +0100)
committerMiod Vallat <miod.vallat@powerdns.com>
Fri, 6 Mar 2026 11:46:49 +0000 (12:46 +0100)
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
23 files changed:
pdns/dnsdistdist/bpf-filter.cc
pdns/dnsdistdist/dnscrypt.cc
pdns/dnsdistdist/dnsdist-actions-factory.cc
pdns/dnsdistdist/dnsdist-carbon.cc
pdns/dnsdistdist/dnsdist-configuration-yaml.cc
pdns/dnsdistdist/dnsdist.cc
pdns/dnsdistdist/doh3.cc
pdns/dnsdistdist/doq.cc
pdns/dnsdistdist/test-dnsdistnghttp2-in_cc.cc
pdns/packethandler.cc
pdns/recursordist/pdns_recursor.cc
pdns/recursordist/rec-lua-conf.cc
pdns/recursordist/rec-main.cc
pdns/recursordist/rec-nsspeeds.cc
pdns/recursordist/rec-rust-lib/cxxsupport.cc
pdns/recursordist/rec-system-resolve.cc
pdns/recursordist/rec-tcp.cc
pdns/recursordist/rec-xfr.cc
pdns/recursordist/recursor_cache.cc
pdns/recursordist/reczones.cc
pdns/recursordist/rpzloader.cc
pdns/recursordist/taskqueue.cc
pdns/remote_logger.cc

index b279dbf5ceaa21c8c81e2e8a285dda09a7f6618f..e651a75b53ed526327586ae00c7df254ff556b3d 100644 (file)
@@ -367,7 +367,7 @@ BPFFilter::BPFFilter(std::unordered_map<std::string, MapConfiguration>& configs,
   /* Check if the current soft memlock limit is at least the limit */
   if (old_limit.rlim_cur < new_limit_size) {
     SLOG(infolog("The current limit of locked memory (soft: %d, hard: %d) is too low for eBPF, trying to raise it to %d", old_limit.rlim_cur, old_limit.rlim_max, new_limit_size),
-         dnsdist::logging::getTopLogger("bpf")->info("The current limit of locked memory is too low for eBPF, trying to raise it", "soft", Logging::Loggable(old_limit.rlim_cur), "hard", Logging::Loggable(old_limit.rlim_max), "target", Logging::Loggable(new_limit_size)));
+         dnsdist::logging::getTopLogger("bpf")->info(Logr::Info, "The current limit of locked memory is too low for eBPF, trying to raise it", "soft", Logging::Loggable(old_limit.rlim_cur), "hard", Logging::Loggable(old_limit.rlim_max), "target", Logging::Loggable(new_limit_size)));
 
     struct rlimit new_limit{};
     new_limit.rlim_cur = new_limit_size;
index 40823e2c969700ae81867306a9a8cf0dbd86d672..6e8947cb5a81a84736a2a7224bb019d19610e2b8 100644 (file)
@@ -509,7 +509,7 @@ void DNSCryptQuery::getDecrypted(bool tcp, PacketBuffer& packet)
   int res = computeSharedKey();
   if (res != 0) {
     VERBOSESLOG(infolog("Dropping encrypted query we can't compute the shared key for"),
-                dnsdist::logging::getTopLogger("dnscrypt")->info("Dropping DNSCrypt-encrypted query we can't compute the shared key for"));
+                dnsdist::logging::getTopLogger("dnscrypt")->info(Logr::Info, "Dropping DNSCrypt-encrypted query we can't compute the shared key for"));
     return;
   }
 
@@ -562,7 +562,7 @@ void DNSCryptQuery::getDecrypted(bool tcp, PacketBuffer& packet)
   uint16_t pos = decryptedQueryLen;
   if (pos >= packet.size()) {
     VERBOSESLOG(infolog("Dropping encrypted query we can't decrypt (invalid position)"),
-                dnsdist::logging::getTopLogger("dnscrypt")->info("Dropping DNSCrypt-encrypted we couldn't decrypt because of an invalid position", "position", Logging::Loggable(pos), "dns.question.size", Logging::Loggable(packet.size())));
+                dnsdist::logging::getTopLogger("dnscrypt")->info(Logr::Info, "Dropping DNSCrypt-encrypted we couldn't decrypt because of an invalid position", "position", Logging::Loggable(pos), "dns.question.size", Logging::Loggable(packet.size())));
     return;
   }
 
@@ -574,7 +574,7 @@ void DNSCryptQuery::getDecrypted(bool tcp, PacketBuffer& packet)
 
   if (pos == 0 || packet.at(pos - 1) != 0x80) {
     VERBOSESLOG(infolog("Dropping encrypted query with invalid padding value"),
-                dnsdist::logging::getTopLogger("dnscrypt")->info("Dropping DNSCrypt-encrypted query with invalid padding value"));
+                dnsdist::logging::getTopLogger("dnscrypt")->info(Logr::Info, "Dropping DNSCrypt-encrypted query with invalid padding value"));
     return;
   }
 
@@ -585,7 +585,7 @@ void DNSCryptQuery::getDecrypted(bool tcp, PacketBuffer& packet)
 
   if (tcp && paddingLen > DNSCRYPT_MAX_TCP_PADDING_SIZE) {
     VERBOSESLOG(infolog("Dropping encrypted query with too long padding size"),
-                dnsdist::logging::getTopLogger("dnscrypt")->info("Dropping DNSCrypt-encrypted query withtoo long padding size"));
+                dnsdist::logging::getTopLogger("dnscrypt")->info(Logr::Info, "Dropping DNSCrypt-encrypted query withtoo long padding size"));
     return;
   }
 
@@ -897,7 +897,7 @@ bool generateDNSCryptCertificate(const std::string& providerPrivateKeyFile, uint
   }
   catch (const std::exception& e) {
     SLOG(errlog(e.what()),
-         dnsdist::logging::getTopLogger("dnscrypt")->error(e.what(), "Error while generating DNSCrypt certificate"));
+         dnsdist::logging::getTopLogger("dnscrypt")->error(Logr::Error, e.what(), "Error while generating DNSCrypt certificate"));
   }
 
   sodium_memzero(providerPrivateKey.data(), providerPrivateKey.size());
index 9488a73cfb52ee1d412fedb2f383677813e803f7..2d4f698201eb1d61267d1eb11019c8850afd6555 100644 (file)
@@ -1249,7 +1249,7 @@ public:
         }
         else {
           SLOG(infolog("Answer to %s for %s %s (%s) with id %u", response->ids.origRemote.toStringWithPort(), response->ids.qname.toString(), QType(response->ids.qtype).toString(), RCode::to_s(response->getHeader()->rcode), response->getHeader()->id),
-               response->getLogger()->info("Logging response packet"));
+               response->getLogger()->info(Logr::Info, "Logging response packet"));
         }
       }
     }
index 3bad273103c274edd96006f487bfc670b738ef08..60c6f894f3105810aac27509c666dee7146e509c 100644 (file)
@@ -328,7 +328,7 @@ static void carbonHandler(const Carbon::Endpoint& endpoint)
         }
         else {
           VERBOSESLOG(infolog("Carbon export for %s took longer (%s us) than the configured interval (%d us)", endpoint.server.toStringWithPort(), elapsedUSec, intervalUSec),
-                      logger->info("Carbon export took longer than the configured interval", "dnsdist.carbon.elapsed_usec", Logging::Loggable(elapsedUSec), "dnsdist.carbon.interval_usec", Logging::Loggable(intervalUSec)));
+                      logger->info(Logr::Info, "Carbon export took longer than the configured interval", "dnsdist.carbon.elapsed_usec", Logging::Loggable(elapsedUSec), "dnsdist.carbon.interval_usec", Logging::Loggable(intervalUSec)));
         }
         consecutiveFailures = 0;
       }
@@ -338,7 +338,7 @@ static void carbonHandler(const Carbon::Endpoint& endpoint)
           consecutiveFailures++;
         }
         VERBOSESLOG(infolog("Run for %s - %s failed, next attempt in %d", endpoint.server.toStringWithPort(), endpoint.getOurName(), backOff),
-                    logger->info("Carbon export failed", "dnsdist.carbon.next_attempt_seconds", Logging::Loggable(backOff)));
+                    logger->info(Logr::Info, "Carbon export failed", "dnsdist.carbon.next_attempt_seconds", Logging::Loggable(backOff)));
         std::this_thread::sleep_for(std::chrono::seconds(backOff));
       }
     } while (true);
index c4cea442a90fe76a84e3a789691709bc3a7efeed..8c44eb32d62ea3a85e280e2d9acb907995629644 100644 (file)
@@ -371,7 +371,7 @@ static bool handleTLSConfiguration(const Context& context, const dnsdist::rust::
     }
     else {
       SLOG(errlog("DOH bind %s is configured to use an unknown library ('%s')", bind.listen_address, frontend->d_library),
-           context.logger->error(Logr::Error, "DoH frontend is configured to use an unknown library", "frontend.address", Logging::Loggable(bind.listen_address), "library", Logging::Loggable(frontend->d_library)));
+           context.logger->info(Logr::Error, "DoH frontend is configured to use an unknown library", "frontend.address", Logging::Loggable(bind.listen_address), "library", Logging::Loggable(frontend->d_library)));
       return false;
     }
 
index 16252a8a3185462a08c441448d7e1699e2f07e39..79c7782c7c18eab9baeddaaea63784bf8a4f6c00 100644 (file)
@@ -143,7 +143,7 @@ static void sendfromto(int sock, const PacketBuffer& buffer, const ComboAddress&
     if (ret == -1) {
       int error = errno;
       VERBOSESLOG(infolog("Error sending UDP response to %s: %s", dest.toStringWithPort(), stringerror(error)),
-                  dnsdist::logging::getTopLogger("sendfromto")->error(error, "Error sending UDP response", "client.address", Logging::Loggable(dest)));
+                  dnsdist::logging::getTopLogger("sendfromto")->error(Logr::Info, error, "Error sending UDP response", "client.address", Logging::Loggable(dest)));
     }
     return;
   }
@@ -153,7 +153,7 @@ static void sendfromto(int sock, const PacketBuffer& buffer, const ComboAddress&
   }
   catch (const std::exception& exp) {
     VERBOSESLOG(infolog("Error sending UDP response from %s to %s: %s", from.toStringWithPort(), dest.toStringWithPort(), exp.what()),
-                dnsdist::logging::getTopLogger("sendfromto")->error(exp.what(), "Error sending UDP response", "source.address", Logging::Loggable(from), "client.address", Logging::Loggable(dest)));
+                dnsdist::logging::getTopLogger("sendfromto")->error(Logr::Info, exp.what(), "Error sending UDP response", "source.address", Logging::Loggable(from), "client.address", Logging::Loggable(dest)));
   }
 }
 
@@ -297,7 +297,7 @@ bool responseContentMatches(const PacketBuffer& response, const DNSName& qname,
   catch (const std::exception& e) {
     if (remote && !response.empty() && static_cast<size_t>(response.size()) > sizeof(dnsheader)) {
       VERBOSESLOG(infolog("Backend %s sent us a response with id %d that did not parse: %s", remote->d_config.remote.toStringWithPort(), ntohs(dnsHeader->id), e.what()),
-                  dnsdist::logging::getTopLogger("udp-response-worker")->error(e.what(), "Received a DNS response from a backend that we could not parse", "backend.address", Logging::Loggable(remote->d_config.remote), "dns.query.id", Logging::Loggable(ntohs(dnsHeader->id))));
+                  dnsdist::logging::getTopLogger("udp-response-worker")->error(Logr::Info, e.what(), "Received a DNS response from a backend that we could not parse", "backend.address", Logging::Loggable(remote->d_config.remote), "dns.query.id", Logging::Loggable(ntohs(dnsHeader->id))));
     }
     ++dnsdist::metrics::g_stats.nonCompliantResponses;
     if (remote) {
@@ -867,17 +867,17 @@ void responderThread(std::shared_ptr<DownstreamState> dss)
       }
       catch (const std::exception& e) {
         VERBOSESLOG(infolog("Got an error in UDP responder thread while parsing a response from %s, id %d: %s", dss->d_config.remote.toStringWithPort(), queryId, e.what()),
-                    responderLogger->error(e.what(), "Got an error in UDP responder thread while parsing a response", "dns.response.id", Logging::Loggable(queryId)));
+                    responderLogger->error(Logr::Info, e.what(), "Got an error in UDP responder thread while parsing a response", "dns.response.id", Logging::Loggable(queryId)));
       }
     }
   }
   catch (const std::exception& e) {
     SLOG(errlog("UDP responder thread died because of exception: %s", e.what()),
-         responderLogger->error(e.what(), "UDP responder thread died because of an exception"));
+         responderLogger->error(Logr::Error, e.what(), "UDP responder thread died because of an exception"));
   }
   catch (const PDNSException& e) {
     SLOG(errlog("UDP responder thread died because of PowerDNS exception: %s", e.reason),
-         responderLogger->error(e.reason, "UDP responder thread died because of a PowerDNS exception"));
+         responderLogger->error(Logr::Error, e.reason, "UDP responder thread died because of a PowerDNS exception"));
   }
   catch (...) {
     SLOG(errlog("UDP responder thread died because of an exception: %s", "unknown"),
@@ -1106,7 +1106,7 @@ static bool applyRulesToQuery(DNSQuestion& dnsQuestion, const timespec& now)
 
       case DNSAction::Action::Nxdomain:
         VERBOSESLOG(infolog("Query from %s turned into NXDomain because of dynamic block", dnsQuestion.ids.origRemote.toStringWithPort()),
-                    dnsQuestion.getLogger()->info("Query turned into NXDomain because of a dynamic rule"));
+                    dnsQuestion.getLogger()->info(Logr::Info, "Query turned into NXDomain because of a dynamic rule"));
         updateBlockStats();
 
         setRCode(RCode::NXDomain);
@@ -1114,7 +1114,7 @@ static bool applyRulesToQuery(DNSQuestion& dnsQuestion, const timespec& now)
 
       case DNSAction::Action::Refused:
         VERBOSESLOG(infolog("Query from %s refused because of dynamic block", dnsQuestion.ids.origRemote.toStringWithPort()),
-                    dnsQuestion.getLogger()->info("Query refused because of a dynamic rule"));
+                    dnsQuestion.getLogger()->info(Logr::Info, "Query refused because of a dynamic rule"));
         updateBlockStats();
 
         setRCode(RCode::Refused);
@@ -1123,7 +1123,7 @@ static bool applyRulesToQuery(DNSQuestion& dnsQuestion, const timespec& now)
       case DNSAction::Action::Truncate:
         if (!dnsQuestion.overTCP()) {
           VERBOSESLOG(infolog("Query from %s truncated because of dynamic block", dnsQuestion.ids.origRemote.toStringWithPort()),
-                      dnsQuestion.getLogger()->info("Query truncated because of a dynamic rule"));
+                      dnsQuestion.getLogger()->info(Logr::Info, "Query truncated because of a dynamic rule"));
           updateBlockStats();
           dnsdist::PacketMangling::editDNSHeaderFromPacket(dnsQuestion.getMutableData(), [](dnsheader& header) {
             header.tc = true;
@@ -1137,12 +1137,12 @@ static bool applyRulesToQuery(DNSQuestion& dnsQuestion, const timespec& now)
         }
         else {
           VERBOSESLOG(infolog("Query from %s for %s over TCP *not* truncated because of dynamic block", dnsQuestion.ids.origRemote.toStringWithPort(), dnsQuestion.ids.qname.toLogString()),
-                      dnsQuestion.getLogger()->info("Query received over TCP *not* truncated because of a dynamic rule"));
+                      dnsQuestion.getLogger()->info(Logr::Info, "Query received over TCP *not* truncated because of a dynamic rule"));
         }
         break;
       case DNSAction::Action::NoRecurse:
         VERBOSESLOG(infolog("Query from %s setting rd=0 because of dynamic block", dnsQuestion.ids.origRemote.toStringWithPort()),
-                    dnsQuestion.getLogger()->info("Setting RD=0 because of a dynamic rule"));
+                    dnsQuestion.getLogger()->info(Logr::Info, "Setting RD=0 because of a dynamic rule"));
         updateBlockStats();
         dnsdist::PacketMangling::editDNSHeaderFromPacket(dnsQuestion.getMutableData(), [](dnsheader& header) {
           header.rd = false;
@@ -1152,13 +1152,13 @@ static bool applyRulesToQuery(DNSQuestion& dnsQuestion, const timespec& now)
       case DNSAction::Action::SetTag: {
         if (!got->second.tagSettings) {
           VERBOSESLOG(infolog("Skipping set tag dynamic block for query from %s because of missing options", dnsQuestion.ids.origRemote.toStringWithPort()),
-                      dnsQuestion.getLogger()->info("Skipping 'set tag' dynamic rule because of missing options"));
+                      dnsQuestion.getLogger()->info(Logr::Info, "Skipping 'set tag' dynamic rule because of missing options"));
           break;
         }
         const auto& tagName = got->second.tagSettings->d_name;
         const auto& tagValue = got->second.tagSettings->d_value;
         VERBOSESLOG(infolog("Query from %s setting tag %s to %s because of dynamic block", dnsQuestion.ids.origRemote.toStringWithPort(), tagName, tagValue),
-                    dnsQuestion.getLogger()->info("Setting tag on query because of a dynamic rule", "dnsdist.tag.name", Logging::Loggable(tagName), "dnsdist.tag.value", Logging::Loggable(tagValue)));
+                    dnsQuestion.getLogger()->info(Logr::Info, "Setting tag on query because of a dynamic rule", "dnsdist.tag.name", Logging::Loggable(tagName), "dnsdist.tag.value", Logging::Loggable(tagValue)));
         updateBlockStats();
         dnsQuestion.setTag(tagName, tagValue);
         // do not return, the whole point it to set a Tag to be able to do further processing in rules
@@ -1166,7 +1166,7 @@ static bool applyRulesToQuery(DNSQuestion& dnsQuestion, const timespec& now)
       }
       default:
         VERBOSESLOG(infolog("Query from %s dropped because of dynamic block", dnsQuestion.ids.origRemote.toStringWithPort()),
-                    dnsQuestion.getLogger()->info("Query dropped because of a dynamic rule"));
+                    dnsQuestion.getLogger()->info(Logr::Info, "Query dropped because of a dynamic rule"));
         updateBlockStats();
         return false;
       }
@@ -1190,21 +1190,21 @@ static bool applyRulesToQuery(DNSQuestion& dnsQuestion, const timespec& now)
         break;
       case DNSAction::Action::Nxdomain:
         VERBOSESLOG(infolog("Query from %s turned into NXDomain because of dynamic block", dnsQuestion.ids.origRemote.toStringWithPort()),
-                    dnsQuestion.getLogger()->info("Query turned into NXDomain because of a suffix-based dynamic rule"));
+                    dnsQuestion.getLogger()->info(Logr::Info, "Query turned into NXDomain because of a suffix-based dynamic rule"));
         updateBlockStats();
 
         setRCode(RCode::NXDomain);
         return true;
       case DNSAction::Action::Refused:
         VERBOSESLOG(infolog("Query from %s refused because of dynamic block", dnsQuestion.ids.origRemote.toStringWithPort()),
-                    dnsQuestion.getLogger()->info("Query refused because of a suffix-based dynamic rule"));
+                    dnsQuestion.getLogger()->info(Logr::Info, "Query refused because of a suffix-based dynamic rule"));
         updateBlockStats();
         setRCode(RCode::Refused);
         return true;
       case DNSAction::Action::Truncate:
         if (!dnsQuestion.overTCP()) {
           VERBOSESLOG(infolog("Query from %s truncated because of dynamic block", dnsQuestion.ids.origRemote.toStringWithPort()),
-                      dnsQuestion.getLogger()->info("Query truncated because of a suffix-based dynamic rule"));
+                      dnsQuestion.getLogger()->info(Logr::Info, "Query truncated because of a suffix-based dynamic rule"));
           updateBlockStats();
           dnsdist::PacketMangling::editDNSHeaderFromPacket(dnsQuestion.getMutableData(), [](dnsheader& header) {
             header.tc = true;
@@ -1218,12 +1218,12 @@ static bool applyRulesToQuery(DNSQuestion& dnsQuestion, const timespec& now)
         }
         else {
           VERBOSESLOG(infolog("Query from %s for %s over TCP *not* truncated because of dynamic block", dnsQuestion.ids.origRemote.toStringWithPort(), dnsQuestion.ids.qname.toLogString()),
-                      dnsQuestion.getLogger()->info("Query received over TCP *not* truncated because of a dynamic rule"));
+                      dnsQuestion.getLogger()->info(Logr::Info, "Query received over TCP *not* truncated because of a dynamic rule"));
         }
         break;
       case DNSAction::Action::NoRecurse:
         VERBOSESLOG(infolog("Query from %s setting rd=0 because of dynamic block", dnsQuestion.ids.origRemote.toStringWithPort()),
-                    dnsQuestion.getLogger()->info("Setting RD=0 because of a suffix-based dynamic rule"));
+                    dnsQuestion.getLogger()->info(Logr::Info, "Setting RD=0 because of a suffix-based dynamic rule"));
         updateBlockStats();
         dnsdist::PacketMangling::editDNSHeaderFromPacket(dnsQuestion.getMutableData(), [](dnsheader& header) {
           header.rd = false;
@@ -1233,13 +1233,13 @@ static bool applyRulesToQuery(DNSQuestion& dnsQuestion, const timespec& now)
       case DNSAction::Action::SetTag: {
         if (!got->tagSettings) {
           VERBOSESLOG(infolog("Skipping set tag dynamic block for query from %s because of missing options", dnsQuestion.ids.origRemote.toStringWithPort()),
-                      dnsQuestion.getLogger()->info("Skipping 'set tag' suffix-based dynamic rule because of missing options"));
+                      dnsQuestion.getLogger()->info(Logr::Info, "Skipping 'set tag' suffix-based dynamic rule because of missing options"));
           break;
         }
         const auto& tagName = got->tagSettings->d_name;
         const auto& tagValue = got->tagSettings->d_value;
         VERBOSESLOG(infolog("Query from %s setting tag %s to %s because of dynamic block", dnsQuestion.ids.origRemote.toStringWithPort(), tagName, tagValue),
-                    dnsQuestion.getLogger()->info("Setting tag on query because of a suffix-based dynamic rule", "dnsdist.tag.name", Logging::Loggable(tagName), "dnsdist.tag.value", Logging::Loggable(tagValue)));
+                    dnsQuestion.getLogger()->info(Logr::Info, "Setting tag on query because of a suffix-based dynamic rule", "dnsdist.tag.name", Logging::Loggable(tagName), "dnsdist.tag.value", Logging::Loggable(tagValue)));
         updateBlockStats();
         dnsQuestion.setTag(tagName, tagValue);
         // do not return, the whole point it to set a Tag to be able to do further processing in rules
@@ -1248,7 +1248,7 @@ static bool applyRulesToQuery(DNSQuestion& dnsQuestion, const timespec& now)
       default:
         updateBlockStats();
         VERBOSESLOG(infolog("Query from %s dropped because of dynamic block", dnsQuestion.ids.origRemote.toStringWithPort()),
-                    dnsQuestion.getLogger()->info("Query dropped because of a suffix-based dynamic rule"));
+                    dnsQuestion.getLogger()->info(Logr::Info, "Query dropped because of a suffix-based dynamic rule"));
         return false;
       }
     }
@@ -1281,7 +1281,7 @@ ssize_t udpClientSendRequestToBackend(const std::shared_ptr<DownstreamState>& ba
   if (result == -1) {
     int savederrno = errno;
     VERBOSESLOG(infolog("Error sending request to backend %s: %s", backend->d_config.remote.toStringWithPort(), stringerror(savederrno)),
-                dnsdist::logging::getTopLogger("udp-frontend")->error(savederrno, "Error sending request to the backend", "backend.address", Logging::Loggable(backend->d_config.remote)));
+                dnsdist::logging::getTopLogger("udp-frontend")->error(Logr::Info, savederrno, "Error sending request to the backend", "backend.address", Logging::Loggable(backend->d_config.remote)));
 
     /* This might sound silly, but on Linux send() might fail with EINVAL
        if the interface the socket was bound to doesn't exist anymore.
@@ -1304,7 +1304,7 @@ static bool isUDPQueryAcceptable(ClientState& clientState, const struct msghdr*
   if ((msgh->msg_flags & MSG_TRUNC) != 0) {
     /* message was too large for our buffer */
     VERBOSESLOG(infolog("Dropping message too large for our buffer"),
-                dnsdist::logging::getTopLogger("udp-query")->info("Dropping query from client that is too large for our buffer", "client.address", Logging::Loggable(remote), "destination.address", Logging::Loggable(dest), "frontend.address", Logging::Loggable(clientState.local)));
+                dnsdist::logging::getTopLogger("udp-query")->info(Logr::Info, "Dropping query from client that is too large for our buffer", "client.address", Logging::Loggable(remote), "destination.address", Logging::Loggable(dest), "frontend.address", Logging::Loggable(clientState.local)));
     ++clientState.nonCompliantQueries;
     ++dnsdist::metrics::g_stats.nonCompliantQueries;
     return false;
@@ -1313,7 +1313,7 @@ static bool isUDPQueryAcceptable(ClientState& clientState, const struct msghdr*
   expectProxyProtocol = clientState.d_enableProxyProtocol && expectProxyProtocolFrom(remote);
   if (!dnsdist::configuration::getCurrentRuntimeConfiguration().d_ACL.match(remote) && !expectProxyProtocol) {
     VERBOSESLOG(infolog("Query from %s dropped because of ACL", remote.toStringWithPort()),
-                dnsdist::logging::getTopLogger("udp-query")->info("Query dropped because of ACL", "source.address", Logging::Loggable(dest)));
+                dnsdist::logging::getTopLogger("udp-query")->info(Logr::Info, "Query dropped because of ACL", "source.address", Logging::Loggable(dest)));
     ++dnsdist::metrics::g_stats.aclDrops;
     return false;
   }
@@ -1548,7 +1548,7 @@ ProcessQueryResult processQueryAfterRules(DNSQuestion& dnsQuestion, std::shared_
         if (serverPool.packetCache->get(dnsQuestion, dnsQuestion.getHeader()->id, &dnsQuestion.ids.cacheKeyNoECS, dnsQuestion.ids.subnet, *dnsQuestion.ids.dnssecOK, willBeForwardedOverUDP, allowExpired, false, true, false)) {
 
           VERBOSESLOG(infolog("Packet cache hit for query for %s|%s from %s (%s, %d bytes)", dnsQuestion.ids.qname.toLogString(), QType(dnsQuestion.ids.qtype).toString(), dnsQuestion.ids.origRemote.toStringWithPort(), dnsQuestion.ids.protocol.toString(), dnsQuestion.getData().size()),
-                      dnsQuestion.getLogger()->info("Packet cache hit"));
+                      dnsQuestion.getLogger()->info(Logr::Info, "Packet cache hit"));
 
           if (!prepareOutgoingResponse(*dnsQuestion.ids.cs, dnsQuestion, true)) {
             return ProcessQueryResult::Drop;
@@ -1565,7 +1565,7 @@ ProcessQueryResult processQueryAfterRules(DNSQuestion& dnsQuestion, std::shared_
 
       if (!handleEDNSClientSubnet(dnsQuestion, dnsQuestion.ids.ednsAdded, dnsQuestion.ids.ecsAdded)) {
         VERBOSESLOG(infolog("Dropping query from %s because we couldn't insert the ECS value", dnsQuestion.ids.origRemote.toStringWithPort()),
-                    dnsQuestion.getLogger()->info("Dropping query because we couldn't insert the ECS value"));
+                    dnsQuestion.getLogger()->info(Logr::Info, "Dropping query because we couldn't insert the ECS value"));
         return ProcessQueryResult::Drop;
       }
     }
@@ -1583,7 +1583,7 @@ ProcessQueryResult processQueryAfterRules(DNSQuestion& dnsQuestion, std::shared_
         });
 
         VERBOSESLOG(infolog("Packet cache hit for query for %s|%s from %s (%s, %d bytes)", dnsQuestion.ids.qname.toLogString(), QType(dnsQuestion.ids.qtype).toString(), dnsQuestion.ids.origRemote.toStringWithPort(), dnsQuestion.ids.protocol.toString(), dnsQuestion.getData().size()),
-                    dnsQuestion.getLogger()->info("Packet cache hit"));
+                    dnsQuestion.getLogger()->info(Logr::Info, "Packet cache hit"));
 
         if (!prepareOutgoingResponse(*dnsQuestion.ids.cs, dnsQuestion, true)) {
           return ProcessQueryResult::Drop;
@@ -1604,7 +1604,7 @@ ProcessQueryResult processQueryAfterRules(DNSQuestion& dnsQuestion, std::shared_
       }
 
       VERBOSESLOG(infolog("Packet cache miss for query for %s|%s from %s (%s, %d bytes)", dnsQuestion.ids.qname.toLogString(), QType(dnsQuestion.ids.qtype).toString(), dnsQuestion.ids.origRemote.toStringWithPort(), dnsQuestion.ids.protocol.toString(), dnsQuestion.getData().size()),
-                  dnsQuestion.getLogger()->info("Packet cache miss"));
+                  dnsQuestion.getLogger()->info(Logr::Info, "Packet cache miss"));
 
       ++dnsdist::metrics::g_stats.cacheMisses;
 
@@ -1641,7 +1641,7 @@ ProcessQueryResult processQueryAfterRules(DNSQuestion& dnsQuestion, std::shared_
       ++dnsdist::metrics::g_stats.noPolicy;
 
       VERBOSESLOG(infolog("%s query for %s|%s from %s, no downstream server available", servFailOnNoPolicy ? "ServFailed" : "Dropped", dnsQuestion.ids.qname.toLogString(), QType(dnsQuestion.ids.qtype).toString(), dnsQuestion.ids.origRemote.toStringWithPort()),
-                  dnsQuestion.getLogger()->info("No downstream server available", "dnsdist.action", Logging::Loggable(servFailOnNoPolicy ? "ServFailed" : "Dropped")));
+                  dnsQuestion.getLogger()->info(Logr::Info, "No downstream server available", "dnsdist.action", Logging::Loggable(servFailOnNoPolicy ? "ServFailed" : "Dropped")));
 
       if (servFailOnNoPolicy) {
         dnsdist::self_answers::removeRecordsAndSetRCode(dnsQuestion, RCode::ServFail);
@@ -1673,7 +1673,7 @@ ProcessQueryResult processQueryAfterRules(DNSQuestion& dnsQuestion, std::shared_
   }
   catch (const std::exception& e) {
     VERBOSESLOG(infolog("Got an error while parsing a %s query (after applying rules)  from %s, id %d: %s", (dnsQuestion.overTCP() ? "TCP" : "UDP"), dnsQuestion.ids.origRemote.toStringWithPort(), queryId, e.what()),
-                dnsQuestion.getLogger()->error(e.what(), "Got an error while parsing a query (after applying rules)"));
+                dnsQuestion.getLogger()->error(Logr::Info, e.what(), "Got an error while parsing a query (after applying rules)"));
   }
   return ProcessQueryResult::Drop;
 }
@@ -1696,7 +1696,7 @@ bool handleTimeoutResponseRules(const std::vector<dnsdist::rules::ResponseRuleAc
   auto protocol = dnsResponse.getProtocol();
 
   VERBOSESLOG(infolog("Handling timeout response rules for incoming protocol = %s", protocol.toString()),
-              dnsResponse.getLogger()->info("Handling timeout response rules"));
+              dnsResponse.getLogger()->info(Logr::Info, "Handling timeout response rules"));
 
   if (protocol == dnsdist::Protocol::DoH) {
 #if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2)
@@ -1718,7 +1718,7 @@ bool handleTimeoutResponseRules(const std::vector<dnsdist::rules::ResponseRuleAc
   }
   catch (const std::exception& exp) {
     VERBOSESLOG(infolog("Exception while processing timeout response rules: %s", exp.what()),
-                dnsResponse.getLogger()->error(exp.what(), "Exception while processing timeout response rules"));
+                dnsResponse.getLogger()->error(Logr::Info, exp.what(), "Exception while processing timeout response rules"));
   }
 
   return dnsResponse.isAsynchronous();
@@ -1732,7 +1732,7 @@ void handleServerStateChange(const string& nameWithAddr, bool newResult)
   }
   catch (const std::exception& exp) {
     SLOG(warnlog("Error calling the Lua hook for Server State Change: %s", exp.what()),
-         dnsdist::logging::getTopLogger("backend-state-update")->error(exp.what(), "Error calling the Lua hook for backend state change", "backend.name", Logging::Loggable(nameWithAddr)));
+         dnsdist::logging::getTopLogger("backend-state-update")->error(Logr::Warning, exp.what(), "Error calling the Lua hook for backend state change", "backend.name", Logging::Loggable(nameWithAddr)));
   }
 }
 
@@ -1847,7 +1847,7 @@ ProcessQueryResult processQuery(DNSQuestion& dnsQuestion, std::shared_ptr<Downst
   }
   catch (const std::exception& e) {
     VERBOSESLOG(infolog("Got an error while parsing a %s query from %s, id %d: %s", (dnsQuestion.overTCP() ? "TCP" : "UDP"), dnsQuestion.ids.origRemote.toStringWithPort(), queryId, e.what()),
-                dnsQuestion.getLogger()->error(e.what(), "Got and error while parsing a query", "dns.question.id", Logging::Loggable(queryId)));
+                dnsQuestion.getLogger()->error(Logr::Info, e.what(), "Got and error while parsing a query", "dns.question.id", Logging::Loggable(queryId)));
   }
   return ProcessQueryResult::Drop;
 }
@@ -1869,7 +1869,7 @@ bool assignOutgoingUDPQueryToBackend(std::shared_ptr<DownstreamState>& downstrea
     }
     catch (const std::exception& e) {
       VERBOSESLOG(infolog("Adding proxy protocol payload to %s query from %s failed: %s", (dnsQuestion.ids.du ? "DoH" : ""), dnsQuestion.ids.origDest.toStringWithPort(), e.what()),
-                  dnsQuestion.getLogger()->error(e.what(), "Adding a proxy protocol payload to the query failed"));
+                  dnsQuestion.getLogger()->error(Logr::Info, e.what(), "Adding a proxy protocol payload to the query failed"));
       return false;
     }
   }
@@ -1887,7 +1887,7 @@ bool assignOutgoingUDPQueryToBackend(std::shared_ptr<DownstreamState>& downstrea
     dnsQuestion.ids.forwardedOverUDP = true;
 
     VERBOSESLOG(infolog("Got query for %s|%s from %s%s, relayed to %s%s", dnsQuestion.ids.qname.toLogString(), QType(dnsQuestion.ids.qtype).toString(), dnsQuestion.ids.origRemote.toStringWithPort(), (doh ? " (https)" : ""), downstream->getNameWithAddr(), actuallySend ? "" : " (xsk)"),
-                dnsQuestion.getLogger()->info("Relayed query to backend", "backend.name", Logging::Loggable(downstream->getName()), "backend.address", Logging::Loggable(downstream->d_config.remote), "dnsdist.xsk", Logging::Loggable(!actuallySend)));
+                dnsQuestion.getLogger()->info(Logr::Info, "Relayed query to backend", "backend.name", Logging::Loggable(downstream->getName()), "backend.address", Logging::Loggable(downstream->d_config.remote), "dnsdist.xsk", Logging::Loggable(!actuallySend)));
 
 #ifndef DISABLE_PROTOBUF
     if (auto tracer = dnsQuestion.ids.getTracer(); dnsQuestion.ids.sendTraceParentToDownstreamID != 0 && tracer != nullptr) {
@@ -2084,7 +2084,7 @@ static void processUDPQuery(ClientState& clientState, const struct msghdr* msgh,
   }
   catch (const std::exception& e) {
     VERBOSESLOG(infolog("Got an error in UDP question thread while parsing a query from %s, id %d: %s", ids.origRemote.toStringWithPort(), queryId, e.what()),
-                dnsdist::logging::getTopLogger("udp-frontend")->error(e.what(), "Got an error in UDP question thread while parsing a query", "source.address", Logging::Loggable(ids.origRemote), "dns.question.id", Logging::Loggable(queryId)));
+                dnsdist::logging::getTopLogger("udp-frontend")->error(Logr::Info, e.what(), "Got an error in UDP question thread while parsing a query", "source.address", Logging::Loggable(ids.origRemote), "dns.question.id", Logging::Loggable(queryId)));
   }
 }
 
@@ -2210,7 +2210,7 @@ bool XskProcessQuery(ClientState& clientState, XskPacket& packet)
   }
   catch (const std::exception& e) {
     VERBOSESLOG(infolog("Got an error in UDP question thread while parsing a query from %s, id %d: %s", ids.origRemote.toStringWithPort(), queryId, e.what()),
-                dnsdist::logging::getTopLogger("udp-xsk-frontend")->error(e.what(), "Got an error in XSK UDP question thread while parsing a query", "source.address", Logging::Loggable(ids.origRemote), "dns.question.id", Logging::Loggable(queryId)));
+                dnsdist::logging::getTopLogger("udp-xsk-frontend")->error(Logr::Info, e.what(), "Got an error in XSK UDP question thread while parsing a query", "source.address", Logging::Loggable(ids.origRemote), "dns.question.id", Logging::Loggable(queryId)));
   }
   return false;
 }
@@ -2283,7 +2283,7 @@ static void MultipleMessagesUDPClientThread(ClientState* clientState)
     if (msgsGot <= 0) {
       int savederrno = errno;
       VERBOSESLOG(infolog("Getting UDP messages via recvmmsg() failed with: %s", stringerror(savederrno)),
-                  dnsdist::logging::getTopLogger("udp-recvmmsg-frontend")->error(savederrno, "Getting UDP messages via recvmmsg failed", "frontend.address", Logging::Loggable(clientState->local)));
+                  dnsdist::logging::getTopLogger("udp-recvmmsg-frontend")->error(Logr::Info, savederrno, "Getting UDP messages via recvmmsg failed", "frontend.address", Logging::Loggable(clientState->local)));
       msgsGot = 0;
       continue;
     }
@@ -2318,7 +2318,7 @@ static void MultipleMessagesUDPClientThread(ClientState* clientState)
       if (sent < 0 || static_cast<unsigned int>(sent) != msgsToSend) {
         int savederrno = errno;
         VERBOSESLOG(infolog("Error sending responses with sendmmsg() (%d on %u): %s", sent, msgsToSend, stringerror(savederrno)),
-                    dnsdist::logging::getTopLogger("udp-sendmmsg-frontend")->error(savederrno, "Error sending responses with sendmmsg()", "address", Logging::Loggable(clientState->local), "dnsdist.sendmmsg.messages_sent", Logging::Loggable(sent), "dnsdist.sendmmsg.messages_to_send", Logging::Loggable(msgsToSend)));
+                    dnsdist::logging::getTopLogger("udp-sendmmsg-frontend")->error(Logr::Info, savederrno, "Error sending responses with sendmmsg()", "address", Logging::Loggable(clientState->local), "dnsdist.sendmmsg.messages_sent", Logging::Loggable(sent), "dnsdist.sendmmsg.messages_to_send", Logging::Loggable(msgsToSend)));
       }
     }
   }
@@ -2437,11 +2437,11 @@ static void udpClientThread(std::vector<ClientState*> states)
   }
   catch (const std::exception& e) {
     SLOG(errlog("UDP client thread died because of exception: %s", e.what()),
-         dnsdist::logging::getTopLogger("udp-frontend")->error(e.what(), "UDP client thread died because of exception"));
+         dnsdist::logging::getTopLogger("udp-frontend")->error(Logr::Error, e.what(), "UDP client thread died because of exception"));
   }
   catch (const PDNSException& e) {
     SLOG(errlog("UDP client thread died because of PowerDNS exception: %s", e.reason),
-         dnsdist::logging::getTopLogger("udp-frontend")->error(e.reason, "UDP client thread died because of PowerDNS exception"));
+         dnsdist::logging::getTopLogger("udp-frontend")->error(Logr::Error, e.reason, "UDP client thread died because of PowerDNS exception"));
   }
   catch (...) {
     SLOG(errlog("UDP client thread died because of an exception: unknown"),
@@ -2621,7 +2621,7 @@ static void healthChecksThread()
     }
     catch (const std::exception& exp) {
       VERBOSESLOG(infolog("Exception in the health-check thread: %s", exp.what()),
-                  dnsdist::logging::getTopLogger("health-check")->error(exp.what(), "Exception in the health-check thread"));
+                  dnsdist::logging::getTopLogger("health-check")->error(Logr::Info, exp.what(), "Exception in the health-check thread"));
     }
   }
 }
@@ -2785,7 +2785,7 @@ static void setupLocalSocket(ClientState& clientState, const ComboAddress& addr,
 #ifdef IPV6_RECVPKTINFO
     if (addr.isIPv6() && setsockopt(socket, IPPROTO_IPV6, IPV6_RECVPKTINFO, &one, sizeof(one)) < 0 && !s_warned_ipv6_recvpktinfo) {
       SLOG(warnlog("Warning: IPV6_RECVPKTINFO setsockopt failed: %s", stringerror()),
-           logger->error(stringerror(), "IPV6_RECVPKTINFO setsockopt failed", "frontend.address", Logging::Loggable(addr)));
+           logger->error(Logr::Warning, stringerror(), "IPV6_RECVPKTINFO setsockopt failed", "frontend.address", Logging::Loggable(addr)));
       s_warned_ipv6_recvpktinfo = true;
     }
 #endif
@@ -3552,7 +3552,7 @@ static ListeningSockets initListeningSockets()
     }
     catch (const std::exception& exp) {
       SLOG(errlog("Unable to bind to control socket on %s: %s", local.toStringWithPort(), exp.what()),
-           dnsdist::logging::getTopLogger("setup")->error(exp.what(), "Unable to bind to console control socket", "network.local.address", Logging::Loggable(local)));
+           dnsdist::logging::getTopLogger("setup")->error(Logr::Error, exp.what(), "Unable to bind to console control socket", "network.local.address", Logging::Loggable(local)));
     }
   }
 
@@ -3565,7 +3565,7 @@ static ListeningSockets initListeningSockets()
     }
     catch (const std::exception& exp) {
       SLOG(errlog("Unable to bind to web server socket on %s: %s", local.toStringWithPort(), exp.what()),
-           dnsdist::logging::getTopLogger("setup")->error(exp.what(), "Unable to bind to web server socket", "network.local.address", Logging::Loggable(local)));
+           dnsdist::logging::getTopLogger("setup")->error(Logr::Error, exp.what(), "Unable to bind to web server socket", "network.local.address", Logging::Loggable(local)));
     }
   }
 
index 59e3adda8db72f7904b0893750d2b03a4741861e..71d19a40ecc84322946cc79c53b596e4130df144 100644 (file)
@@ -168,7 +168,7 @@ public:
     if (!unit->ids.selfGenerated) {
       auto udiff = unit->ids.queryRealTime.udiff();
       VERBOSESLOG(infolog("Got answer from %s, relayed to %s (DoH3, %d bytes), took %d us", unit->downstream->d_config.remote.toStringWithPort(), unit->ids.origRemote.toStringWithPort(), unit->response.size(), udiff),
-                  dnsResponse.getLogger()->info("Got answer from backend, relayed to client"));
+                  dnsResponse.getLogger()->info(Logr::Info, "Got answer from backend, relayed to client"));
 
       auto backendProtocol = unit->downstream->getProtocol();
       if (backendProtocol == dnsdist::Protocol::DoUDP && unit->tcp) {
@@ -514,7 +514,7 @@ static void processDOH3Query(DOH3UnitUniquePtr&& doh3Unit)
 
     if (!dnsdist::configuration::getCurrentRuntimeConfiguration().d_ACL.match(remote)) {
       VERBOSESLOG(infolog("Query from %s (DoH3) dropped because of ACL", remote.toStringWithPort()),
-                  dsc->df->getLogger().info("DoH3 query dropped because of ACL", "client.address", Logging::Loggable(remote)));
+                  dsc->df->getLogger().info(Logr::Info, "DoH3 query dropped because of ACL", "client.address", Logging::Loggable(remote)));
       ++dnsdist::metrics::g_stats.aclDrops;
       unit->response.clear();
 
@@ -697,7 +697,7 @@ static void flushResponses(pdns::channel::Receiver<DOH3Unit>& receiver, const Lo
     }
     catch (const std::exception& e) {
       SLOG(errlog("Error while processing response received over DoH3: %s", e.what()),
-           frontendLogger.error(e.what(), "Error while processing response received over DoH3"));
+           frontendLogger.error(Logr::Error, e.what(), "Error while processing response received over DoH3"));
     }
     catch (...) {
       SLOG(errlog("Unspecified error while processing response received over DoH3"),
index 5126d01b6d8f2c41d817bc50d06ce1d9e94d9eb4..43cce00ab7949bf17e898db09a1c38c528e07ac7 100644 (file)
@@ -163,7 +163,7 @@ public:
     if (!unit->ids.selfGenerated) {
       auto udiff = unit->ids.queryRealTime.udiff();
       VERBOSESLOG(infolog("Got answer from %s, relayed to %s (quic, %d bytes), took %d us", unit->downstream->d_config.remote.toStringWithPort(), unit->ids.origRemote.toStringWithPort(), unit->response.size(), udiff),
-                  dnsResponse.getLogger()->info("Got answer from backend, relayed to client"));
+                  dnsResponse.getLogger()->info(Logr::Info, "Got answer from backend, relayed to client"));
 
       auto backendProtocol = unit->downstream->getProtocol();
       if (backendProtocol == dnsdist::Protocol::DoUDP && unit->tcp) {
@@ -424,7 +424,7 @@ static void processDOQQuery(DOQUnitUniquePtr&& doqUnit)
 
     if (!dnsdist::configuration::getCurrentRuntimeConfiguration().d_ACL.match(remote)) {
       VERBOSESLOG(infolog("Query from %s (DoQ) dropped because of ACL", remote.toStringWithPort()),
-                  dsc->df->getLogger().info("DoQ query dropped because of ACL", "client.address", Logging::Loggable(remote)));
+                  dsc->df->getLogger().info(Logr::Info, "DoQ query dropped because of ACL", "client.address", Logging::Loggable(remote)));
       ++dnsdist::metrics::g_stats.aclDrops;
       unit->response.clear();
 
@@ -597,7 +597,7 @@ static void flushResponses(pdns::channel::Receiver<DOQUnit>& receiver, const Log
     }
     catch (const std::exception& e) {
       SLOG(errlog("Error while processing response received over DoQ: %s", e.what()),
-           frontendLogger.error(e.what(), "Error while processing response received over DoQ"));
+           frontendLogger.error(Logr::Error, e.what(), "Error while processing response received over DoQ"));
     }
     catch (...) {
       SLOG(errlog("Unspecified error while processing response received over DoQ"),
index ee319bf3686d8cee2e6e30b5560fe0187f7ba010..feb9e408e6f518d894f4b0e158cb54eb1460187f 100644 (file)
@@ -267,7 +267,7 @@ private:
         }
         catch (const std::exception& e) {
           SLOG(infolog("Error parsing the status header for stream ID %d: %s", frame->hd.stream_id, e.what()),
-               dnsdist::logging::getTopLogger("nghttp2-incoming-unit-tests")->error(e.what(), "Error parsing the status header for stream", "http.stream_id", Logging::Loggable(frame->hd.stream_id)));
+               dnsdist::logging::getTopLogger("nghttp2-incoming-unit-tests")->error(Logr::Info, e.what(), "Error parsing the status header for stream", "http.stream_id", Logging::Loggable(frame->hd.stream_id)));
           return NGHTTP2_ERR_CALLBACK_FAILURE;
         }
       }
index ba2fab54be25bbd8e1c62f0fa5fce0e920c3fbab..890242093f3ecae721c11ef9bf0f5cb2d35c2bd4 100644 (file)
@@ -355,7 +355,7 @@ void PacketHandler::getBestDNAMESynth(DNSPacket& p, DNSName &target, vector<DNSZ
   DNSName subdomain(target);
   do {
     DLOG(SLOG(g_log<<"Attempting DNAME lookup for "<<subdomain<<", d_sd.qname()="<<d_sd.qname()<<endl,
-              d_slog->info("Attempting DNAME lookup", "subdomain", Logging::Loggable(subdomain), "name", Logging::Loggable(d_sd.qname()))));
+              d_slog->info(Logr::Debug, "Attempting DNAME lookup", "subdomain", Logging::Loggable(subdomain), "name", Logging::Loggable(d_sd.qname()))));
 
     B.lookup(QType(QType::DNAME), subdomain, d_sd.domain_id, &p);
     while(B.get(rr)) {
@@ -412,12 +412,12 @@ bool PacketHandler::getBestWildcard(DNSPacket& p, const DNSName &target, DNSName
       if (rr.dr.d_type == QType::LUA && !isPresigned()) {
         if(!doLua) {
           DLOG(SLOG(g_log<<"Have a wildcard Lua match, but not doing Lua record for this zone"<<endl,
-                    d_slog->info("Have a wildcard Lua match, but not doing Lua record for this zone")));
+                    d_slog->info(Logr::Debug, "Have a wildcard Lua match, but not doing Lua record for this zone")));
           continue;
         }
 
         DLOG(SLOG(g_log<<"Have a wildcard Lua match"<<endl,
-                  d_slog->info("Have a wildcard Lua match")));
+                  d_slog->info(Logr::Debug, "Have a wildcard Lua match")));
 
         auto rec=getRR<LUARecordContent>(rr.dr);
         if (!rec) {
@@ -426,7 +426,7 @@ bool PacketHandler::getBestWildcard(DNSPacket& p, const DNSName &target, DNSName
         if(rec->d_type == QType::CNAME || rec->d_type == p.qtype.getCode() || (p.qtype.getCode() == QType::ANY && rec->d_type != QType::RRSIG)) {
           //    noCache=true;
           DLOG(SLOG(g_log<<"Executing Lua: '"<<rec->getCode()<<"'"<<endl,
-                    d_slog->info("Executing Lua", "code", Logging::Loggable(rec->getCode()))));
+                    d_slog->info(Logr::Debug, "Executing Lua", "code", Logging::Loggable(rec->getCode()))));
           try {
             auto recvec=luaSynth(d_slog, rec->getCode(), target, rr, d_sd.qname(), p, rec->d_type, s_LUA);
             for (const auto& r : recvec) {
@@ -470,7 +470,7 @@ bool PacketHandler::getBestWildcard(DNSPacket& p, const DNSName &target, DNSName
     B.lookup(QType(QType::ANY), subdomain, d_sd.domain_id, &p);
     if (B.get(rr)) {
       DLOG(SLOG(g_log<<"No wildcard match, ancestor exists"<<endl,
-                d_slog->info("No wildcard match, ancestor exists")));
+                d_slog->info(Logr::Debug, "No wildcard match, ancestor exists")));
       B.lookupEnd();
       break;
     }
@@ -885,12 +885,12 @@ bool PacketHandler::getNSEC3Hashes(bool narrow, const std::string& hashed, bool
 void PacketHandler::addNSEC3(DNSPacket& p, std::unique_ptr<DNSPacket>& r, const DNSName& target, const DNSName& wildcard, const NSEC3PARAMRecordContent& ns3rc, bool narrow, int mode)
 {
   DLOG(SLOG(g_log<<"addNSEC3() mode="<<mode<<" auth="<<d_sd.qname()<<" target="<<target<<" wildcard="<<wildcard<<endl,
-            d_slog->info("addNSEC3()", "mode", Logging::Loggable(mode), "auth", Logging::Loggable(d_sd.qname()), "target", Logging::Loggable(target), "wildcard", Logging::Loggable(wildcard))));
+            d_slog->info(Logr::Debug, "addNSEC3()", "mode", Logging::Loggable(mode), "auth", Logging::Loggable(d_sd.qname()), "target", Logging::Loggable(target), "wildcard", Logging::Loggable(wildcard))));
 
   if (d_sd.db == nullptr) {
     if(!B.getSOAUncached(d_sd.zonename, d_sd)) {
       DLOG(SLOG(g_log<<"Could not get SOA for domain"<<endl,
-                d_slog->info("Could not get SOA for domain")));
+                d_slog->info(Logr::Debug, "Could not get SOA for domain")));
       return;
     }
   }
@@ -921,13 +921,13 @@ void PacketHandler::addNSEC3(DNSPacket& p, std::unique_ptr<DNSPacket>& r, const
     unhashed=(mode == 0 || mode == 1 || mode == 5) ? target : closest;
     hashed=hashQNameWithSalt(ns3rc, unhashed);
     DLOG(SLOG(g_log<<"1 hash: "<<toBase32Hex(hashed)<<" "<<unhashed<<endl,
-              d_slog->info("1 hash", "hash", Logging::Loggable(toBase32Hex(hashed)), "unhashed", Logging::Loggable(unhashed))));
+              d_slog->info(Logr::Debug, "1 hash", "hash", Logging::Loggable(toBase32Hex(hashed)), "unhashed", Logging::Loggable(unhashed))));
 
     getNSEC3Hashes(narrow, hashed, false, unhashed, before, after, mode);
 
     if (((mode == 0 && ns3rc.d_flags) ||  mode == 1) && (hashed != before)) {
       DLOG(SLOG(g_log<<"No matching NSEC3, do closest (provable) encloser"<<endl,
-                d_slog->info("No matching NSEC3, do closest (provable) encloser")));
+                d_slog->info(Logr::Debug, "No matching NSEC3, do closest (provable) encloser")));
 
       bool doBreak = false;
       DNSZoneRecord rr;
@@ -947,14 +947,14 @@ void PacketHandler::addNSEC3(DNSPacket& p, std::unique_ptr<DNSPacket>& r, const
       unhashed=closest;
       hashed=hashQNameWithSalt(ns3rc, unhashed);
       DLOG(SLOG(g_log<<"1 hash: "<<toBase32Hex(hashed)<<" "<<unhashed<<endl,
-                d_slog->info("1 hash", "hash", Logging::Loggable(toBase32Hex(hashed)), "unhashed", Logging::Loggable(unhashed))));
+                d_slog->info(Logr::Debug, "1 hash", "hash", Logging::Loggable(toBase32Hex(hashed)), "unhashed", Logging::Loggable(unhashed))));
 
       getNSEC3Hashes(narrow, hashed, false, unhashed, before, after);
     }
 
     if (!after.empty()) {
       DLOG(SLOG(g_log<<"Done calling for matching, hashed: '"<<toBase32Hex(hashed)<<"' before='"<<toBase32Hex(before)<<"', after='"<<toBase32Hex(after)<<"'"<<endl,
-                d_slog->info("Done calling for matching", "hash", Logging::Loggable(toBase32Hex(hashed)), "before", Logging::Loggable(toBase32Hex(before)), "after", Logging::Loggable(toBase32Hex(after)))));
+                d_slog->info(Logr::Debug, "Done calling for matching", "hash", Logging::Loggable(toBase32Hex(hashed)), "before", Logging::Loggable(toBase32Hex(before)), "after", Logging::Loggable(toBase32Hex(after)))));
       emitNSEC3(p, r, ns3rc, unhashed, before, after, mode);
     }
   }
@@ -969,11 +969,11 @@ void PacketHandler::addNSEC3(DNSPacket& p, std::unique_ptr<DNSPacket>& r, const
 
     hashed=hashQNameWithSalt(ns3rc, unhashed);
     DLOG(SLOG(g_log<<"2 hash: "<<toBase32Hex(hashed)<<" "<<unhashed<<endl,
-              d_slog->info("2 hash", "hash", Logging::Loggable(toBase32Hex(hashed)), "unhashed", Logging::Loggable(unhashed))));
+              d_slog->info(Logr::Debug, "2 hash", "hash", Logging::Loggable(toBase32Hex(hashed)), "unhashed", Logging::Loggable(unhashed))));
 
     getNSEC3Hashes(narrow, hashed, true, unhashed, before, after);
     DLOG(SLOG(g_log<<"Done calling for covering, hashed: '"<<toBase32Hex(hashed)<<"' before='"<<toBase32Hex(before)<<"', after='"<<toBase32Hex(after)<<"'"<<endl,
-              d_slog->info("Done calling for covering", "hash", Logging::Loggable(toBase32Hex(hashed)), "before", Logging::Loggable(toBase32Hex(before)), "after", Logging::Loggable(toBase32Hex(after)))));
+              d_slog->info(Logr::Debug, "Done calling for covering", "hash", Logging::Loggable(toBase32Hex(hashed)), "before", Logging::Loggable(toBase32Hex(before)), "after", Logging::Loggable(toBase32Hex(after)))));
     emitNSEC3(p, r, ns3rc, unhashed, before, after, mode);
   }
 
@@ -983,11 +983,11 @@ void PacketHandler::addNSEC3(DNSPacket& p, std::unique_ptr<DNSPacket>& r, const
 
     hashed=hashQNameWithSalt(ns3rc, unhashed);
     DLOG(SLOG(g_log<<"3 hash: "<<toBase32Hex(hashed)<<" "<<unhashed<<endl,
-              d_slog->info("3 hash", "hashed", Logging::Loggable(toBase32Hex(hashed)), "unhashed", Logging::Loggable(unhashed))));
+              d_slog->info(Logr::Debug, "3 hash", "hashed", Logging::Loggable(toBase32Hex(hashed)), "unhashed", Logging::Loggable(unhashed))));
 
     getNSEC3Hashes(narrow, hashed, (mode != 2), unhashed, before, after);
     DLOG(SLOG(g_log<<"Done calling for '*', hashed: '"<<toBase32Hex(hashed)<<"' before='"<<toBase32Hex(before)<<"', after='"<<toBase32Hex(after)<<"'"<<endl,
-              d_slog->info("Done calling for '*'", "hash", Logging::Loggable(toBase32Hex(hashed)), "before", Logging::Loggable(toBase32Hex(before)), "after", Logging::Loggable(toBase32Hex(after)))));
+              d_slog->info(Logr::Debug, "Done calling for '*'", "hash", Logging::Loggable(toBase32Hex(hashed)), "before", Logging::Loggable(toBase32Hex(before)), "after", Logging::Loggable(toBase32Hex(after)))));
     emitNSEC3(p, r, ns3rc, unhashed, before, after, mode);
   }
 }
@@ -995,12 +995,12 @@ void PacketHandler::addNSEC3(DNSPacket& p, std::unique_ptr<DNSPacket>& r, const
 void PacketHandler::addNSEC(DNSPacket& /* p */, std::unique_ptr<DNSPacket>& r, const DNSName& target, const DNSName& wildcard, int mode)
 {
   DLOG(SLOG(g_log<<"addNSEC() mode="<<mode<<" auth="<<d_sd.qname()<<" target="<<target<<" wildcard="<<wildcard<<endl,
-            d_slog->info("addNSEC()", "mode", Logging::Loggable(mode), "auth", Logging::Loggable(d_sd.qname()), "target", Logging::Loggable(target), "wildcard", Logging::Loggable(wildcard))));
+            d_slog->info(Logr::Debug, "addNSEC()", "mode", Logging::Loggable(mode), "auth", Logging::Loggable(d_sd.qname()), "target", Logging::Loggable(target), "wildcard", Logging::Loggable(wildcard))));
 
   if (d_sd.db == nullptr) {
     if(!B.getSOAUncached(d_sd.zonename, d_sd)) {
       DLOG(SLOG(g_log<<"Could not get SOA for domain"<<endl,
-                d_slog->info("Could not get SOA for domain")));
+                d_slog->info(Logr::Debug, "Could not get SOA for domain")));
       return;
     }
   }
@@ -1492,7 +1492,7 @@ bool PacketHandler::tryWildcard(DNSPacket& p, std::unique_ptr<DNSPacket>& r, DNS
 
   if(rrset.empty()) {
     DLOG(SLOG(g_log<<"Wildcard matched something, but not of the correct type"<<endl,
-              d_slog->info("Wildcard matched something, but not of the correct type")));
+              d_slog->info(Logr::Debug, "Wildcard matched something, but not of the correct type")));
     nodata=true;
   }
   else {
@@ -1812,13 +1812,13 @@ bool PacketHandler::opcodeQueryInner2(DNSPacket& pkt, queryState &state, bool re
   }
 
   DLOG(SLOG(g_log<<"Checking for referrals first, unless this is a DS query"<<endl,
-            d_slog->info("Checking for referrals first, unless this is a DS query")));
+            d_slog->info(Logr::Debug, "Checking for referrals first, unless this is a DS query")));
   if(pkt.qtype.getCode() != QType::DS && tryReferral(pkt, state.r, state.target, retargeted)) {
     return true;
   }
 
   DLOG(SLOG(g_log<<"Got no referrals, trying ANY"<<endl,
-            d_slog->info("Got no referrals, trying ANY")));
+            d_slog->info(Logr::Debug, "Got no referrals, trying ANY")));
 
 #ifdef HAVE_LUA_RECORDS
   bool doLua = doLuaRecords();
@@ -1926,10 +1926,10 @@ bool PacketHandler::opcodeQueryInner2(DNSPacket& pkt, queryState &state, bool re
   }
 
   DLOG(SLOG(g_log<<"After first ANY query for '"<<state.target<<"', id="<<d_sd.domain_id<<": weDone="<<weDone<<", weHaveUnauth="<<weHaveUnauth<<", weRedirected="<<weRedirected<<", haveAlias='"<<haveAlias<<"'"<<endl,
-            d_slog->info("After first ANY query", "query", Logging::Loggable(state.target), "id", Logging::Loggable(d_sd.domain_id), "weDone", Logging::Loggable(weDone), "weHaveUnauth", Logging::Loggable(weHaveUnauth), "weRedirected", Logging::Loggable(weRedirected), "haveAlias", Logging::Loggable(haveAlias))));
+            d_slog->info(Logr::Debug, "After first ANY query", "query", Logging::Loggable(state.target), "id", Logging::Loggable(d_sd.domain_id), "weDone", Logging::Loggable(weDone), "weHaveUnauth", Logging::Loggable(weHaveUnauth), "weRedirected", Logging::Loggable(weRedirected), "haveAlias", Logging::Loggable(haveAlias))));
   if(pkt.qtype.getCode() == QType::DS && weHaveUnauth &&  !weDone && !weRedirected) {
     DLOG(SLOG(g_log<<"Q for DS of a name for which we do have NS, but for which we don't have DS; need to provide an AUTH answer that shows we don't"<<endl,
-              d_slog->info("Query for DS of a name for which we do have NS, but don't have any DS; need to provide an AUTH answer that shows this")));
+              d_slog->info(Logr::Debug, "Query for DS of a name for which we do have NS, but don't have any DS; need to provide an AUTH answer that shows this")));
     makeNOError(pkt, state.r, state.target, DNSName(), 1);
     return true;
   }
@@ -1945,7 +1945,7 @@ bool PacketHandler::opcodeQueryInner2(DNSPacket& pkt, queryState &state, bool re
   // referral for DS query
   if(pkt.qtype.getCode() == QType::DS) {
     DLOG(SLOG(g_log<<"Qtype is DS"<<endl,
-              d_slog->info("QType is DS")));
+              d_slog->info(Logr::Debug, "QType is DS")));
     bool doReferral = true;
     if(d_dk.doesDNSSEC()) {
       for(auto& loopRR: rrset) {
@@ -1969,10 +1969,10 @@ bool PacketHandler::opcodeQueryInner2(DNSPacket& pkt, queryState &state, bool re
     }
     if(doReferral) {
       DLOG(SLOG(g_log<<"DS query found no direct result, trying referral now"<<endl,
-                d_slog->info("DS query found no direct result, trying referral now")));
+                d_slog->info(Logr::Debug, "DS query found no direct result, trying referral now")));
       if(tryReferral(pkt, state.r, state.target, retargeted)) {
         DLOG(SLOG(g_log<<"Got referral for DS query"<<endl,
-                  d_slog->info("Got referral for DS query")));
+                  d_slog->info(Logr::Debug, "Got referral for DS query")));
         return true;
       }
     }
@@ -2063,7 +2063,7 @@ bool PacketHandler::opcodeQueryInner2(DNSPacket& pkt, queryState &state, bool re
   }
   else if(weHaveUnauth) {
     DLOG(SLOG(g_log<<"Have unauth data, so need to hunt for best NS records"<<endl,
-              d_slog->info("Have unauth data, searching for best NS record")));
+              d_slog->info(Logr::Debug, "Have unauth data, searching for best NS record")));
     if (tryReferral(pkt, state.r, state.target, retargeted)) {
       return true;
     }
@@ -2081,7 +2081,7 @@ bool PacketHandler::opcodeQueryInner2(DNSPacket& pkt, queryState &state, bool re
   }
   else {
     DLOG(SLOG(g_log<<"Have some data, but not the right data"<<endl,
-              d_slog->info("Have some data, but not the right data")));
+              d_slog->info(Logr::Debug, "Have some data, but not the right data")));
     makeNOError(pkt, state.r, state.target, DNSName(), 0);
   }
   return true;
index 475f6077ca074aa3ab9f606a03045f669519e59c..7e22bb1f5083970ee0e0a5b07d389a2ae653fc33 100644 (file)
@@ -1953,7 +1953,7 @@ void startDoResolve(void* arg) // NOLINT(readability-function-cognitive-complexi
       std::rethrow_if_nested(e);
     }
     catch (const std::exception& ne) {
-      resolver.d_slog->error(Logr::Error, ne.what(), "Nested exception in resolver context", Logging::Loggable("std::exception"));
+      resolver.d_slog->error(Logr::Error, ne.what(), "Nested exception in resolver context", "exception", Logging::Loggable("std::exception"));
     }
     catch (...) {
       ;
@@ -2321,7 +2321,7 @@ static string* doProcessUDPQuestion(const std::string& question, const ComboAddr
           }
           catch (const MOADNSException& moadnsexception) {
             if (g_logCommonErrors) {
-              g_slogudpin->error(moadnsexception.what(), "Error parsing a query packet for tag determination", "qname", Logging::Loggable(qname), "exception", Logging::Loggable("MOADNSException"));
+              g_slogudpin->error(Logr::Error, moadnsexception.what(), "Error parsing a query packet for tag determination", "qname", Logging::Loggable(qname), "exception", Logging::Loggable("MOADNSException"));
             }
           }
           catch (const std::exception& stdException) {
index fb49e46a6bb69371dae93f8c27e617610cac2363..7c1ca4fd9ed37f970f0956210c8e7d0838276549 100644 (file)
@@ -351,7 +351,7 @@ static void rpzPrimary(LuaConfigItems& lci, const boost::variant<string, std::ve
     lci.d_slog->error(Logr::Error, e.what(), "Exception configuring 'rpzPrimary'", "exception", Logging::Loggable("std::exception"));
   }
   catch (const PDNSException& e) {
-    lci.d_slog->error(Logr::Error, e.reason, "Exception configuring 'rpzPrimary'", Logging::Loggable("PDNSException"));
+    lci.d_slog->error(Logr::Error, e.reason, "Exception configuring 'rpzPrimary'", "exception", Logging::Loggable("PDNSException"));
   }
 }
 
@@ -651,10 +651,10 @@ void loadRecursorLuaConfig(const std::string& fname, ProxyMapping& proxyMapping,
         parseProtobufOptions(vars, lci.outgoingProtobufExportConfig);
       }
       catch (std::exception& e) {
-        lci.d_slog->error(Logr::Error, "Exception while starting outgoing protobuf logger", "exception", Logging::Loggable("std::exception"));
+        lci.d_slog->error(Logr::Error, e.what(), "Exception while starting outgoing protobuf logger", "exception", Logging::Loggable("std::exception"));
       }
       catch (PDNSException& e) {
-        lci.d_slog->error(Logr::Error, "Exception while starting outgoing protobuf logger", "exception", Logging::Loggable("PDNSException"));
+        lci.d_slog->error(Logr::Error, e.reason, "Exception while starting outgoing protobuf logger", "exception", Logging::Loggable("PDNSException"));
       }
     }
     else {
@@ -687,14 +687,14 @@ void loadRecursorLuaConfig(const std::string& fname, ProxyMapping& proxyMapping,
         parseFrameStreamOptions(vars, lci.frameStreamExportConfig);
       }
       catch (std::exception& e) {
-        lci.d_slog->error(Logr::Error, "Exception reading config for dnstap framestream logger", "exception", Logging::Loggable("std::exception"));
+        lci.d_slog->error(Logr::Error, e.what(), "Exception reading config for dnstap framestream logger", "exception", Logging::Loggable("std::exception"));
       }
       catch (PDNSException& e) {
-        lci.d_slog->error(Logr::Error, "Exception reading config for dnstap framestream logger", "exception", Logging::Loggable("PDNSException"));
+        lci.d_slog->error(Logr::Error, e.reason, "Exception reading config for dnstap framestream logger", "exception", Logging::Loggable("PDNSException"));
       }
     }
     else {
-      lci.d_slog->info(Logr::Error,  "Only one dnstapFrameStreamServer() directive can be configured",  "existing", Logging::Loggable(lci.frameStreamExportConfig.servers.at(0)));
+      lci.d_slog->info(Logr::Error, "Only one dnstapFrameStreamServer() directive can be configured",  "existing", Logging::Loggable(lci.frameStreamExportConfig.servers.at(0)));
     }
   });
   // NOLINTNEXTLINE(performance-unnecessary-value-param) Lua wrapper does not handle optional &
@@ -720,14 +720,14 @@ void loadRecursorLuaConfig(const std::string& fname, ProxyMapping& proxyMapping,
         parseFrameStreamOptions(vars, lci.nodFrameStreamExportConfig);
       }
       catch (std::exception& e) {
-        lci.d_slog->error(Logr::Error, "Exception reading config for dnstap NOD framestream logger", "exception", Logging::Loggable("std::exception"));
+        lci.d_slog->error(Logr::Error, e.what(), "Exception reading config for dnstap NOD framestream logger", "exception", Logging::Loggable("std::exception"));
       }
       catch (PDNSException& e) {
-        lci.d_slog->error(Logr::Error, "Exception reading config for dnstap NOD framestream logger", "exception", Logging::Loggable("PDNSException"));
+        lci.d_slog->error(Logr::Error, e.reason, "Exception reading config for dnstap NOD framestream logger", "exception", Logging::Loggable("PDNSException"));
       }
     }
     else {
-      lci.d_slog->info(Logr::Error,  "Only one dnstapNODFrameStreamServer() directive can be configured",  "existing", Logging::Loggable(lci.nodFrameStreamExportConfig.servers.at(0)));
+      lci.d_slog->info(Logr::Error, "Only one dnstapNODFrameStreamServer() directive can be configured",  "existing", Logging::Loggable(lci.nodFrameStreamExportConfig.servers.at(0)));
     }
   });
 #endif /* HAVE_FSTRM */
index 63414a06541d6406507c1a6856a318a7aef7e400..e0b8a8f46eff9a5742b986e346eb9d86ea0781fd 100644 (file)
@@ -2362,7 +2362,7 @@ static void handlePipeRequest(int fileDesc, FDMultiplexer::funcparam_t& /* var *
   }
   catch (const MOADNSException& moadnsexception) {
     if (g_logCommonErrors) {
-      g_slog->withName("runtime")->error(moadnsexception.what(), "PIPE function created an exception", "exception", Logging::Loggable("MOADNSException"));
+      g_slog->withName("runtime")->error(Logr::Error, moadnsexception.what(), "PIPE function created an exception", "exception", Logging::Loggable("MOADNSException"));
     }
   }
   catch (const std::exception& stdException) {
@@ -2942,14 +2942,14 @@ static pair<int, bool> doConfig(Logr::log_t startupLog, const string& configname
     if (config == "check") {
       try {
         if (!::arg().file(configname)) {
-          startupLog->error("No such file", "Unable to open configuration file", "config_file", Logging::Loggable(configname));
+          startupLog->error(Logr::Error, "No such file", "Unable to open configuration file", "config_file", Logging::Loggable(configname));
           return {1, true};
         }
         ::arg().parse(argc, argv);
         return {0, true};
       }
       catch (const ArgException& argException) {
-        startupLog->error("Cannot parse configuration", "Unable to parse configuration file", "config_file", Logging::Loggable(configname), "reason", Logging::Loggable(argException.reason));
+        startupLog->error(Logr::Error, "Cannot parse configuration", "Unable to parse configuration file", "config_file", Logging::Loggable(configname), "reason", Logging::Loggable(argException.reason));
         return {1, true};
       }
     }
@@ -2959,7 +2959,7 @@ static pair<int, bool> doConfig(Logr::log_t startupLog, const string& configname
     }
     else if (config == "diff") {
       if (!::arg().laxFile(configname)) {
-        startupLog->error("No such file", "Unable to open configuration file", "config_file", Logging::Loggable(configname));
+        startupLog->error(Logr::Error, "No such file", "Unable to open configuration file", "config_file", Logging::Loggable(configname));
         return {1, true};
       }
       ::arg().laxParse(argc, argv);
@@ -2967,7 +2967,7 @@ static pair<int, bool> doConfig(Logr::log_t startupLog, const string& configname
     }
     else {
       if (!::arg().laxFile(configname)) {
-        startupLog->error("No such file", "Unable to open configuration file", "config_file", Logging::Loggable(configname));
+        startupLog->error(Logr::Error, "No such file", "Unable to open configuration file", "config_file", Logging::Loggable(configname));
         return {1, true};
       }
       ::arg().laxParse(argc, argv);
@@ -3191,7 +3191,7 @@ int main(int argc, char** argv)
         return ret;
       }
       if (!::arg().file(configname)) {
-        startupLog->error("No such file", "Unable to open configuration file", "config_file", Logging::Loggable(configname));
+        startupLog->error(Logr::Error, "No such file", "Unable to open configuration file", "config_file", Logging::Loggable(configname));
       }
       else {
         if (!::arg().mustDo("enable-old-settings")) {
index 112addc4b96943e4a506db507a0f29153c89b7ae..3daef07e29dc7e0a8b048e5ddcfc3c8116e3d75d 100644 (file)
@@ -214,7 +214,7 @@ size_t nsspeeds_t::putPB(time_t cutoff, const std::string& pbuf)
     log->error(Logr::Error, e.what(), "Exception processing cache dump");
   }
   catch (...) {
-    log->error(Logr::Error, "Other exception processing cache dump");
+    log->info(Logr::Error, "Other exception processing cache dump");
   }
   return 0;
 }
index a8cf4e4c3252350961a46ec8d0bb84b9f5f7d208..ff672514991c0d85da7376fd1c804531880dde66 100644 (file)
@@ -200,7 +200,7 @@ static void possiblyConvertACLFile(const string& includeDir, const string& apiDi
   ofconf << yaml << endl;
   ofconf.close();
   if (ofconf.bad()) {
-    log->error(Logr::Error, "Error writing YAML", "to", Logging::Loggable(tmpfilename));
+    log->info(Logr::Error, "Error writing YAML", "to", Logging::Loggable(tmpfilename));
     unlink(tmpfilename.c_str());
     throw runtime_error("YAML Conversion");
   }
@@ -255,7 +255,7 @@ static void fileCopy(const string& src, const string& dst, Logr::log_t log)
   ifconf.close();
   ofconf.close();
   if (ofconf.bad()) {
-    log->error(Logr::Error, "Error writing YAML", "to", Logging::Loggable(dst));
+    log->info(Logr::Error, "Error writing YAML", "to", Logging::Loggable(dst));
     throw runtime_error("YAML Conversion");
   }
 }
index 3f43b98eec0c6975994aec695e30513006280edb..31e16c564372955aaf35596a17278f60902f2056 100644 (file)
@@ -209,7 +209,7 @@ bool pdns::RecResolve::refresh(time_t now)
         ttd += d_ttl;
       }
       else {
-        log->error(Logr::Error, "Name did not resolve", "name", Logging::Loggable(entry.first));
+        log->info(Logr::Error, "Name did not resolve", "name", Logging::Loggable(entry.first));
       }
       if (newAddress != entry.second.d_address) {
         log->info(Logr::Debug, "Name resolved to new address",
@@ -323,7 +323,7 @@ ComboAddress pdns::fromNameOrIP(const string& str, uint16_t defPort, Logr::log_t
       address.setPort(port);
       return address;
     }
-    log->error(Logr::Error, "Could not resolve name", "name", Logging::Loggable(str));
+    log->info(Logr::Error, "Could not resolve name", "name", Logging::Loggable(str));
     throw PDNSException("Could not resolve " + str);
   }
 }
index de3f787d7d58a68f4ff2c120fb5d8501839a28ea..e19a7fadbd712b6cbda1fa13759a3b3728495219 100644 (file)
@@ -368,7 +368,7 @@ static void doProcessTCPQuestion(std::unique_ptr<DNSComboWriter>& comboWriter, s
         }
         catch (const MOADNSException& moadnsexception) {
           if (g_logCommonErrors) {
-            g_slogtcpin->error(moadnsexception.what(), "Error parsing a query packet for tag determination", "qname", Logging::Loggable(qname), "exception", Logging::Loggable("MOADNSException"));
+            g_slogtcpin->error(Logr::Error, moadnsexception.what(), "Error parsing a query packet for tag determination", "qname", Logging::Loggable(qname), "exception", Logging::Loggable("MOADNSException"));
           }
         }
         catch (const std::exception& stdException) {
index 846ebbe0f6671c49201594dedbd5bb89098516d9..778a25a46a3086cea61f5fc2e83621a49de82f06 100644 (file)
@@ -471,7 +471,7 @@ void FWCatZoneXFR::zoneXFRTracker(ZoneXFRParams params, uint64_t configGeneratio
     oldZone = g_luaconfs.getLocal()->catalogzones.at(params.zoneIdx).d_catz;
   }
   if (!oldZone) {
-    logger->error(Logr::Error, "Unable to retrieve catalog zone from configuration", "index", Logging::Loggable(params.zoneIdx));
+    logger->info(Logr::Error, "Unable to retrieve catalog zone from configuration", "index", Logging::Loggable(params.zoneIdx));
     return;
   }
 
index 94dc86de48a941aaf52ad27cbbcf840951527cdb..22f55078ab0b61a4b6549e0dfa9db2d10290ee75 100644 (file)
@@ -1298,7 +1298,7 @@ size_t MemRecursorCache::putRecordSets(const std::string& pbuf)
     log->error(Logr::Error, e.what(), "Exception processing cache dump");
   }
   catch (...) {
-    log->error(Logr::Error, "Other exception processing cache dump");
+    log->info(Logr::Error, "Other exception processing cache dump");
   }
   return 0;
 }
index 8192a045badf0869b923bf605ba01e0f1badf2a6..9684ade54f3a68c2af011a8ea340b2a849ddb685 100644 (file)
@@ -412,7 +412,7 @@ static void processExportEtcHosts(std::shared_ptr<SyncRes::domainmap_t>& newMap,
   string fname = ::arg()["etc-hosts-file"];
   ifstream ifs(fname);
   if (!ifs) {
-    log->error(Logr::Warning, "Could not open file for reading", "file", Logging::Loggable(fname));
+    log->info(Logr::Warning, "Could not open file for reading", "file", Logging::Loggable(fname));
     return;
   }
   vector<string> parts;
index b1e143182ef1de89179abed8d3ee952c1c9e8b59..ce436ef25e60760a455505d8f883cdb75f8f066a 100644 (file)
@@ -692,7 +692,7 @@ void RPZIXFRTracker(RPZTrackerParams params, uint64_t configGeneration)
   /* we can _never_ modify this zone directly, we need to do a full copy then replace the existing zone */
   std::shared_ptr<DNSFilterEngine::Zone> oldZone = g_luaconfs.getLocal()->dfe.getZone(params.zoneXFRParams.zoneIdx);
   if (!oldZone) {
-    logger->error(Logr::Error, "Unable to retrieve RPZ zone from configuration", "index", Logging::Loggable(params.zoneXFRParams.zoneIdx));
+    logger->info(Logr::Error, "Unable to retrieve RPZ zone from configuration", "index", Logging::Loggable(params.zoneXFRParams.zoneIdx));
     return;
   }
 
index d18a8cb8c9cab181f6ba3117931a9fcdad88c94a..b335866362f7daa4625ea6fa81c40ede7d197845 100644 (file)
@@ -49,7 +49,7 @@ bool ResolveTask::run(bool logErrors) const
 {
   if (d_func == nullptr) {
     auto log = g_slog->withName("taskq")->withValues("name", Logging::Loggable(d_qname), "qtype", Logging::Loggable(QType(d_qtype).toString()));
-    log->error(Logr::Debug, "null task");
+    log->info(Logr::Debug, "null task");
     return false;
   }
   struct timeval now{};
index 064450e1ef3e399588af0db0187548a057dd3737..306d4418489fb6c513f768f668ba019aa9593ab0 100644 (file)
@@ -139,7 +139,7 @@ bool RemoteLogger::reconnect()
          g_slog->withName("protobuf")->error(Logr::Error, e.what(), "Exception while connecting to remote logger", "address", Logging::Loggable(d_remote)));
 #else
     SLOG(warnlog("Error connecting to remote logger %s: %s", d_remote.toStringWithPort(), e.what()),
-         dnsdist::logging::getTopLogger("protobuf")->error(e.what(), "Exception while connecting to remote logger", "address", Logging::Loggable(d_remote))
+         dnsdist::logging::getTopLogger("protobuf")->error(Logr::Error, e.what(), "Exception while connecting to remote logger", "address", Logging::Loggable(d_remote))
       );
 #endif
 
@@ -254,7 +254,7 @@ void RemoteLogger::maintenanceThread()
          g_slog->withName("protobuf")->error(Logr::Error, e.what(), "Remote Logger's maintenance thread died"));
 #else
     SLOG(errlog("Remote Logger's maintenance thread died on: %s", e.what()),
-         dnsdist::logging::getTopLogger("protobuf")->error(e.what(), "Remote Logger's maintenance thread died")
+         dnsdist::logging::getTopLogger("protobuf")->error(Logr::Error, e.what(), "Remote Logger's maintenance thread died")
       );
 #endif
   }