]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2445] Make sure buffer is flushed in dhcp[46] stand-alone
authorJelte Jansen <jelte@isc.org>
Tue, 4 Dec 2012 17:34:59 +0000 (09:34 -0800)
committerJelte Jansen <jelte@isc.org>
Tue, 4 Dec 2012 17:34:59 +0000 (09:34 -0800)
even when -s was not given but it reverts to standalone because of a session error

src/bin/dhcp4/main.cc
src/bin/dhcp6/main.cc

index 4bf55ea4d689fa72b3f179202882394619c13bef..45f1de16126b97f4c666c482b5c052752bfa82fc 100644 (file)
@@ -17,6 +17,7 @@
 #include <dhcp4/ctrl_dhcp4_srv.h>
 #include <dhcp4/dhcp4_log.h>
 #include <log/logger_support.h>
+#include <log/logger_manager.h>
 
 #include <boost/lexical_cast.hpp>
 
@@ -113,6 +114,10 @@ main(int argc, char* argv[]) {
                 LOG_ERROR(dhcp4_logger, DHCP4_SESSION_FAIL).arg(ex.what());
                 // Let's continue. It is useful to have the ability to run
                 // DHCP server in stand-alone mode, e.g. for testing
+                // We do need to make sure logging is no longer buffered
+                // since then it would not print until dhcp6 is stopped
+                isc::log::LoggerManager log_manager;
+                log_manager.process();
             }
         } else {
             LOG_DEBUG(dhcp4_logger, DBG_DHCP4_START, DHCP4_STANDALONE);
index 501a00a876f3db5e355b214bb5b6027511d2e957..ced742292373bd8ccada27b7d9223698e7807104 100644 (file)
@@ -17,6 +17,7 @@
 #include <dhcp6/ctrl_dhcp6_srv.h>
 #include <dhcp6/dhcp6_log.h>
 #include <log/logger_support.h>
+#include <log/logger_manager.h>
 
 #include <boost/lexical_cast.hpp>
 
@@ -122,6 +123,10 @@ main(int argc, char* argv[]) {
                 LOG_ERROR(dhcp6_logger, DHCP6_SESSION_FAIL).arg(ex.what());
                 // Let's continue. It is useful to have the ability to run
                 // DHCP server in stand-alone mode, e.g. for testing
+                // We do need to make sure logging is no longer buffered
+                // since then it would not print until dhcp6 is stopped
+                isc::log::LoggerManager log_manager;
+                log_manager.process();
             }
         } else {
             LOG_DEBUG(dhcp6_logger, DBG_DHCP6_START, DHCP6_STANDALONE);