sr.setDNSSECValidationRequested(g_dnssecmode != DNSSECMode::Off && g_dnssecmode != DNSSECMode::ProcessNoValidate);
sr.setAsyncCallback(asyncCallback);
+ const string msg = "Failed to update . records";
vector<DNSRecord> ret;
int res = -1;
try {
}
}
}
- catch(const PDNSException& e) {
- g_log<<Logger::Error<<"Failed to update . records, got an exception: "<<e.reason<<endl;
+ catch (const PDNSException& e) {
+ SLOG(g_log<<Logger::Error<<"Failed to update . records, got an exception: "<<e.reason<<endl,
+ log->error(Logr::Error, e.reason, msg, "exception", Logging::Loggable("PDNSException")));
}
- catch(const ImmediateServFailException& e) {
- g_log<<Logger::Error<<"Failed to update . records, got an exception: "<<e.reason<<endl;
+ catch (const ImmediateServFailException& e) {
+ SLOG(g_log<<Logger::Error<<"Failed to update . records, got an exception: "<<e.reason<<endl,
+ log->error(Logr::Error, e.reason, msg, "exception", Logging::Loggable("ImmediateServFailException")));
}
- catch(const PolicyHitException& e) {
- g_log<<Logger::Error<<"Failed to update . records, got a policy hit"<<endl;
+ catch (const PolicyHitException& e) {
+ SLOG(g_log<<Logger::Error<<"Failed to update . records, got a policy hit"<<endl,
+ log->info(Logr::Error, msg, "exception", Logging::Loggable("PolicyHitException")));
ret.clear();
}
- catch(const std::exception& e) {
- g_log<<Logger::Error<<"Failed to update . records, got an exception: "<<e.what()<<endl;
+ catch (const std::exception& e) {
+ SLOG(g_log<<Logger::Error<<"Failed to update . records, got an exception: "<<e.what()<<endl,
+ log->error(Logr::Error, e.what(), msg, "exception", Logging::Loggable("std::exception")));
}
- catch(...) {
- g_log<<Logger::Error<<"Failed to update . records, got an exception"<<endl;
+ catch (...) {
+ SLOG(g_log<<Logger::Error<<"Failed to update . records, got an exception"<<endl,
+ log->info(Logr::Error, msg));
}
if (res == 0) {
log->info(Logr::Debug, "Refreshed . records"));
}
else {
- g_log<<Logger::Warning<<"Failed to update root NS records, RCODE="<<res<<endl;
+ SLOG(g_log<<Logger::Warning<<"Failed to update root NS records, RCODE="<<res<<endl,
+ log->info(Logr::Warning, msg, "rcode", Logging::Loggable(res)));
}
return res;
}