From: Otto Moerbeek Date: Tue, 31 May 2022 09:17:01 +0000 (+0200) Subject: Somewhat more info in housekeeping and directResolve X-Git-Tag: auth-4.8.0-alpha0~70^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11662%2Fhead;p=thirdparty%2Fpdns.git Somewhat more info in housekeeping and directResolve --- diff --git a/pdns/recursordist/rec-main.cc b/pdns/recursordist/rec-main.cc index e1b43a860d..0164e9893e 100644 --- a/pdns/recursordist/rec-main.cc +++ b/pdns/recursordist/rec-main.cc @@ -2057,24 +2057,25 @@ static void houseKeeping(void*) if (res == 0) { // Success, go back to the defaut period rootUpdateTask.setPeriod(std::max(SyncRes::s_maxcachettl * 8 / 10, minRootRefreshInterval)); + const string msg = "Exception while priming the root NS zones"; try { primeRootNSZones(g_dnssecmode, 0); } catch (const std::exception& e) { SLOG(g_log << Logger::Error << "Exception while priming the root NS zones: " << e.what() << endl, - log->error(Logr::Error, e.what(), "Exception while priming the root NS zones")); + log->error(Logr::Error, e.what(), msg, "exception", Logging::Loggable("std::exception"))); } catch (const PDNSException& e) { SLOG(g_log << Logger::Error << "Exception while priming the root NS zones: " << e.reason << endl, - log->error(Logr::Error, e.reason, "Exception while priming the root NS zones")); + log->error(Logr::Error, e.reason, msg, "exception", Logging::Loggable("PDNSException"))); } catch (const ImmediateServFailException& e) { SLOG(g_log << Logger::Error << "Exception while priming the root NS zones: " << e.reason << endl, - log->error(Logr::Error, e.reason, "Exception while priming the root NS zones")); + log->error(Logr::Error, e.reason, msg, "exception", Logging::Loggable("ImmediateServFailException"))); } catch (const PolicyHitException& e) { SLOG(g_log << Logger::Error << "Policy hit while priming the root NS zones" << endl, - log->info(Logr::Error, "Policy hit while priming the root NS zones")); + log->info(Logr::Error, msg, "exception", Logging::Loggable("PolicyHitException"))); } catch (...) { SLOG(g_log << Logger::Error << "Exception while priming the root NS zones" << endl, diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 19528bd5aa..cc6b9b4266 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -5645,7 +5645,7 @@ int directResolve(const DNSName& qname, const QType qtype, const QClass qclass, } int res = -1; - const std::string msg = "Failed to resolve"; + const std::string msg = "Exception while resolving"; try { res = sr.beginResolve(qname, qtype, qclass, ret, 0); } @@ -5661,7 +5661,7 @@ int directResolve(const DNSName& qname, const QType qtype, const QClass qclass, } catch(const PolicyHitException& e) { SLOG(g_log<error(Logr::Error, "Policy Hit", msg, "exception", Logging::Loggable("PolicyHitException"))); + log->info(Logr::Error, msg, "exception", Logging::Loggable("PolicyHitException"))); ret.clear(); } catch(const std::exception& e) { @@ -5671,7 +5671,7 @@ int directResolve(const DNSName& qname, const QType qtype, const QClass qclass, } catch(...) { SLOG(g_log<error(Logr::Error, "Exception", msg)); + log->info(Logr::Error, msg)); ret.clear(); }