GlobalStateHolder<SuffixMatchNode> g_DoTToAuthNames;
uint64_t g_latencyStatSize;
-static pdns::RateLimitedLog s_rateLimitedLogger;
-
LWResult::Result UDPClientSocks::getSocket(const ComboAddress& toaddr, int* fileDesc)
{
*fileDesc = makeClientSocket(toaddr.sin4.sin_family);
eventTrace.add(RecEventTrace::LuaGetTag, ctag, false);
}
}
+ catch (const MOADNSException& moadnsexception) {
+ if (g_logCommonErrors) {
+ g_slogudpin->error(moadnsexception.what(), "Error parsing a query packet for tag determination", "qname", Logging::Loggable(qname), "excepion", Logging::Loggable("MOADNSException"));
+ }
+ }
catch (const std::exception& stdException) {
- s_rateLimitedLogger.log(g_slogudpin, "Error parsing a query packet for tag determination", stdException, "qname", Logging::Loggable(qname), "remote", Logging::Loggable(fromaddr));
+ g_rateLimitedLogger.log(g_slogudpin, "Error parsing a query packet for tag determination", stdException, "qname", Logging::Loggable(qname), "remote", Logging::Loggable(fromaddr));
}
}
}
catch (const std::exception& stdException) {
- s_rateLimitedLogger.log(g_slogudpin, "Error parsing a query packet for tag determination, setting tag=0", stdException);
+ g_rateLimitedLogger.log(g_slogudpin, "Error parsing a query packet for tag determination, setting tag=0", stdException);
}
}
unsigned int RecThreadInfo::s_numTCPWorkerThreads;
thread_local unsigned int RecThreadInfo::t_id;
-static pdns::RateLimitedLog s_rateLimitedLogger;
+pdns::RateLimitedLog g_rateLimitedLogger;
static std::map<unsigned int, std::set<int>> parseCPUMap(Logr::log_t log)
{
resp = tmsg->func();
}
catch (const PDNSException& pdnsException) {
- s_rateLimitedLogger.log(g_slog->withName("runtime"), "PIPE function", pdnsException);
+ g_rateLimitedLogger.log(g_slog->withName("runtime"), "PIPE function", pdnsException);
+ }
+ catch (const MOADNSException& moadnsexception) {
+ if (g_logCommonErrors) {
+ g_slog->withName("runtime")->error(moadnsexception.what(), "PIPE function created an exception", "excepion", Logging::Loggable("MOADNSException"));
+ }
}
catch (const std::exception& stdException) {
- s_rateLimitedLogger.log(g_slog->withName("runtime"), "PIPE function", stdException);
+ g_rateLimitedLogger.log(g_slog->withName("runtime"), "PIPE function", stdException);
}
catch (...) {
- s_rateLimitedLogger.log(g_slog->withName("runtime"), "PIPE function");
+ g_rateLimitedLogger.log(g_slog->withName("runtime"), "PIPE function");
}
if (tmsg->wantAnswer) {
if (write(RecThreadInfo::self().getPipes().writeFromThread, &resp, sizeof(resp)) != sizeof(resp)) {
runTCPMaintenance(threadInfo, listenOnTCP, maxTcpClients);
}
catch (const PDNSException& pdnsException) {
- s_rateLimitedLogger.log(g_slog->withName("runtime"), "recLoop", pdnsException);
+ g_rateLimitedLogger.log(g_slog->withName("runtime"), "recLoop", pdnsException);
}
catch (const std::exception& stdException) {
- s_rateLimitedLogger.log(g_slog->withName("runtime"), "recLoop", stdException);
+ g_rateLimitedLogger.log(g_slog->withName("runtime"), "recLoop", stdException);
}
catch (...) {
- s_rateLimitedLogger.log(g_slog->withName("runtime"), "recLoop");
+ g_rateLimitedLogger.log(g_slog->withName("runtime"), "recLoop");
}
}
}
#include "rec_channel.hh"
#include "threadname.hh"
#include "recpacketcache.hh"
+#include "ratelimitedlog.hh"
#ifdef NOD_ENABLED
#include "nod.hh"
extern thread_local std::unique_ptr<ProxyMapping> t_proxyMapping;
using ProxyMappingStats_t = std::unordered_map<Netmask, ProxyMappingCounts>;
+extern pdns::RateLimitedLog g_rateLimitedLogger;
#ifdef NOD_ENABLED
extern bool g_nodEnabled;
// constructing the PB message.
comboWriter->d_policyTags = comboWriter->d_gettagPolicyTags;
}
- catch (const std::exception& e) {
+ catch (const MOADNSException& moadnsexception) {
if (g_logCommonErrors) {
- SLOG(g_log << Logger::Warning << "Error parsing a query packet qname='" << qname << "' for tag determination, setting tag=0: " << e.what() << endl,
- g_slogtcpin->info(Logr::Warning, "Error parsing a query packet for tag determination, setting tag=0", "remote", Logging::Loggable(conn->d_remote), "qname", Logging::Loggable(qname)));
+ g_slogtcpin->error(moadnsexception.what(), "Error parsing a query packet for tag determination", "qname", Logging::Loggable(qname), "excepion", Logging::Loggable("MOADNSException"));
}
}
+ catch (const std::exception& stdException) {
+ g_rateLimitedLogger.log(g_slogtcpin, "Error parsing a query packet for tag determination", stdException, "qname", Logging::Loggable(qname), "remote", Logging::Loggable(conn->d_remote));
+ }
}
}
- catch (const std::exception& e) {
- if (g_logCommonErrors) {
- SLOG(g_log << Logger::Warning << "Error parsing a query packet for tag determination, setting tag=0: " << e.what() << endl,
- g_slogtcpin->error(Logr::Warning, e.what(), "Error parsing a query packet for tag determination, setting tag=0", "exception", Logging::Loggable("std::exception"), "remote", Logging::Loggable(conn->d_remote)));
- }
+ catch (const std::exception& stdException) {
+ g_rateLimitedLogger.log(g_slogudpin, "Error parsing a query packet for tag determination, setting tag=0", stdException, "remote", Logging::Loggable(conn->d_remote));
}
}