zone->setName(polName);
zoneIdx = lci.dfe.addZone(zone);
- auto log = lci.d_slog->withValues("seedfile", Logging::Loggable(seedFile), "zone", Logging::Loggable(zoneName));
+ auto log = lci.d_slog->withValues("seedfile", Logging::Loggable(seedFile), "zone", Logging::Loggable(zoneName));
if (!seedFile.empty()) {
SLOG(g_log << Logger::Info << "Pre-loading RPZ zone " << zoneName << " from seed file '" << seedFile << "'" << endl,
log->info(Logr::Info, "Pre-loading RPZ zone from seed file"));
static void handleRCC(int fd, FDMultiplexer::funcparam_t& var)
{
+ auto log = g_slog->withName("control");
try {
FDWrapper clientfd = accept(fd, nullptr, nullptr);
if (clientfd == -1) {
throw PDNSException("accept failed");
}
string msg = g_rcc.recv(clientfd).d_str;
- g_log << Logger::Info << "Received rec_control command '" << msg << "' via controlsocket" << endl;
+ SLOG(g_log << Logger::Info << "Received rec_control command '" << msg << "' via controlsocket" << endl,
+ log->info(Logr::Info, "Received rec_control command via controlsocket", "command", Logging::Loggable(msg)));
RecursorControlParser rcp;
RecursorControlParser::func_t* command;
command();
}
catch (const std::exception& e) {
- g_log << Logger::Error << "Error dealing with control socket request: " << e.what() << endl;
+ SLOG(g_log << Logger::Error << "Error dealing with control socket request: " << e.what() << endl,
+ log->error(Logr::Error, e.what(), "Exception while dealing with control request", "exception", Logging::Loggable("std::exception")));
}
catch (const PDNSException& ae) {
- g_log << Logger::Error << "Error dealing with control socket request: " << ae.reason << endl;
+ SLOG(g_log << Logger::Error << "Error dealing with control socket request: " << ae.reason << endl,
+ log->error(Logr::Error, ae.reason, "Exception while dealing with control request", "exception", Logging::Loggable("PDNSException")));
}
}
#endif
#ifdef PDNS_CONFIG_ARGS
#include "logger.hh"
-#include "logging.hh"
#define WE_ARE_RECURSOR
#else
#include "dolog.hh"
#endif
+#include "logging.hh"
bool CircularWriteBuffer::hasRoomFor(const std::string& str) const
{
}
catch (const std::exception& e)
{
- SLOG(g_log << "Remote Logger's maintenance thead died on: " << e.what() << endl,
+ SLOG(cerr << "Remote Logger's maintenance thead died on: " << e.what() << endl,
g_slog->withName("protobuf")->error(Logr::Error, e.what(), "Remote Logger's maintenance thead died"));
}
catch (...) {
- SLOG(g_log << "Remote Logger's maintenance thead died on unknown exception" << endl,
+ SLOG(cerr << "Remote Logger's maintenance thead died on unknown exception" << endl,
g_slog->withName("protobuf")->info(Logr::Error, "Remote Logger's maintenance thead died"));
}
}