From: Pieter Lexis Date: Tue, 8 Dec 2020 14:09:03 +0000 (+0100) Subject: stub: improve logging X-Git-Tag: rec-4.5.0-alpha1~59^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F9848%2Fhead;p=thirdparty%2Fpdns.git stub: improve logging --- diff --git a/pdns/stubresolver.cc b/pdns/stubresolver.cc index 98cd70fe54..737436d1f5 100644 --- a/pdns/stubresolver.cc +++ b/pdns/stubresolver.cc @@ -30,6 +30,8 @@ static bool s_stubResolvConfigured = false; static time_t s_localResolvConfMtime = 0; static time_t s_localResolvConfLastCheck = 0; +static string logPrefix = "[stub-resolver] "; + /* * Returns false if no resolvers are configured, while emitting a warning about this */ @@ -37,7 +39,7 @@ bool resolversDefined() { ReadLock l(&s_resolversForStubLock); if (s_resolversForStub.empty()) { - g_log<& r pw.getHeader()->id=dns_random_uint16(); pw.getHeader()->rd=1; - string msg ="Doing stub resolving, using resolvers: "; + string queryNameType = qname.toString() + "|" + QType(qtype).getName(); + string msg ="Doing stub resolving for '" + queryNameType + "', using resolvers: "; for (const auto& server : s_resolversForStub) { msg += server.toString() + ", "; } - g_log<& r ret.push_back(zrr); } } - g_log<