]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Print version earlier, logging tweak
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 13 Oct 2023 07:53:43 +0000 (09:53 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 13 Oct 2023 08:00:47 +0000 (10:00 +0200)
pdns/recursordist/rec-main.cc
pdns/recursordist/settings/cxxsupport.cc

index f61c81968396df121510e1a1aa7384316130ff81..51f3bdabd360eec38896f7f86c9a4355f588a8c1 100644 (file)
@@ -2028,8 +2028,6 @@ static int serviceMain(Logr::log_t log)
     }
   }
 
-  showProductVersion();
-
   g_disthashseed = dns_random_uint32();
 
   int ret = initNet(log);
@@ -3314,6 +3312,7 @@ int main(int argc, char** argv)
     }
     g_log.setLoglevel(s_logUrgency);
     g_log.toConsole(s_logUrgency);
+    showProductVersion();
 
     g_yamlSettings = false;
     string configname = ::arg()["config-dir"] + "/recursor";
index 051ca54b5f81ddf04b8cec414d1d6fc70d101f82..0251fbae7b716bb75e55f7d703d64309a1163607 100644 (file)
@@ -124,12 +124,12 @@ void pdns::settings::rec::oldStyleAllowFileToBridgeStruct(const std::string& fil
 
 static void mergeYamlSubFile(const std::string& configname, Recursorsettings& settings, Logr::log_t log)
 {
-  SLOG(g_log << Logger::Notice << "Processing YAML settings from " << configname << endl,
-       log->info(Logr::Notice, "Processing YAML settings", "path", Logging::Loggable(configname)));
   auto file = ifstream(configname);
   if (!file.is_open()) {
     throw runtime_error("Cannot open " + configname);
   }
+  SLOG(g_log << Logger::Notice << "Processing YAML settings from " << configname << endl,
+       log->info(Logr::Notice, "Processing YAML settings", "path", Logging::Loggable(configname)));
   auto data = string(std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>());
   pdns::rust::settings::rec::merge(settings, data);
 }