From 88d0f2dcb5a8f85348b0f2f93d2e7dd1557fcc14 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Wed, 23 Feb 2022 07:44:45 +0100 Subject: [PATCH] Use structured logging --- pdns/recursordist/rec-taskqueue.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pdns/recursordist/rec-taskqueue.cc b/pdns/recursordist/rec-taskqueue.cc index 883b26087d..22f03df404 100644 --- a/pdns/recursordist/rec-taskqueue.cc +++ b/pdns/recursordist/rec-taskqueue.cc @@ -182,7 +182,8 @@ void runTaskOnce(bool logErrors) void pushAlmostExpiredTask(const DNSName& qname, uint16_t qtype, time_t deadline) { if (SyncRes::isUnsupported(qtype)) { - g_log << Logger::Error << "Cannot push task for " << QType(qtype).toString() << endl; + auto log = g_slog->withName("taskq")->withValues("name", Logging::Loggable(qname), "qtype", Logging::Loggable(QType(qtype).toString())); + log->error(Logr::Error, "Cannot push task", "qtype unsupported"); return; } pdns::ResolveTask task{qname, qtype, deadline, true, resolve}; @@ -192,6 +193,11 @@ void pushAlmostExpiredTask(const DNSName& qname, uint16_t qtype, time_t deadline void pushResolveTask(const DNSName& qname, uint16_t qtype, time_t now, time_t deadline) { + if (SyncRes::isUnsupported(qtype)) { + auto log = g_slog->withName("taskq")->withValues("name", Logging::Loggable(qname), "qtype", Logging::Loggable(QType(qtype).toString())); + log->error(Logr::Error, "Cannot push task", "qtype unsupported"); + return; + } pdns::ResolveTask task{qname, qtype, deadline, false, resolve}; auto lock = s_taskQueue.lock(); bool inserted = lock->rateLimitSet.insert(now, task); -- 2.47.2