]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5074] Rename d2_logger to dctl_logger in libkea-process.
authorMarcin Siodelski <marcin@isc.org>
Thu, 1 Dec 2016 12:43:58 +0000 (13:43 +0100)
committerMarcin Siodelski <marcin@isc.org>
Thu, 1 Dec 2016 12:43:58 +0000 (13:43 +0100)
14 files changed:
doc/guide/logging.xml
src/bin/d2/d2_log.cc
src/bin/d2/d2_log.h
src/bin/d2/d2_process.cc
src/bin/d2/d2_queue_mgr.cc
src/lib/process/Makefile.am
src/lib/process/d_cfg_mgr.cc
src/lib/process/d_controller.cc
src/lib/process/d_controller.h
src/lib/process/d_log.cc [moved from src/lib/process/d2_log.cc with 87% similarity]
src/lib/process/d_log.h [moved from src/lib/process/d2_log.h with 100% similarity]
src/lib/process/io_service_signal.cc
src/lib/process/tests/run_unittests.cc
src/lib/process/testutils/d_test_stubs.cc

index 3a260a38742b8c518f86151ba6dca029d6bd53c1..24f9bbea7ace58c4fb3a436d0675048ef84380ec 100644 (file)
             </simpara>
           </listitem>
 
+          <listitem>
+            <simpara>
+              <command>kea-dhcp-ddns.dctl</command> - the logger used by the
+              kea-dhcp-ddns daemon for logging basic information about the
+              process, received signals and triggered reconfigurations.
+            </simpara>
+          </listitem>
+
           <listitem>
             <simpara>
               <command>kea-dhcp-ddns.dhcpddns</command> - the logger used by the
-              kea-dhcp-ddns daemon for logging configuration and global event
-              information.  This logger does not specify logging settings for
-              libraries used by the daemon.
+              kea-dhcp-ddns daemon for logging events related to DDNS operations.
             </simpara>
           </listitem>
 
index daadcf41182ad6f7ec1876809945448fc56d89d7..1b292a7b610fee4262f3e0020886ed3d6a9e2f3e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -12,7 +12,7 @@ namespace isc {
 namespace d2 {
 
 /// @brief Defines the logger used within D2.
-isc::log::Logger dctl_logger("dhcpddns");
+isc::log::Logger d2_logger("dhcpddns");
 isc::log::Logger dhcp_to_d2_logger("dhcp-to-d2");
 isc::log::Logger d2_to_dns_logger("d2-to-dns");
 
index e6728527c58962a82e29ca6bdd568bb33dc7e60a..2333a0c962970325dd2a0cb90f392539b0fa3cdf 100644 (file)
@@ -15,7 +15,7 @@ namespace isc {
 namespace d2 {
 
 /// Define the loggers for the "d2" logging.
-extern isc::log::Logger dctl_logger;
+extern isc::log::Logger d2_logger;
 extern isc::log::Logger dhcp_to_d2_logger;
 extern isc::log::Logger d2_to_dns_logger;
 
index bc435e1f0328d67dbb8b8575492214f1b9e797ac..313296838e8b86ceffa5be015b8321ca88f9065b 100644 (file)
@@ -42,7 +42,7 @@ D2Process::init() {
 
 void
 D2Process::run() {
-    LOG_INFO(dctl_logger, DHCP_DDNS_STARTED).arg(VERSION);
+    LOG_INFO(d2_logger, DHCP_DDNS_STARTED).arg(VERSION);
     // Loop forever until we are allowed to shutdown.
     while (!canShutdown()) {
         try {
@@ -68,7 +68,7 @@ D2Process::run() {
                           "Primary IO service stopped unexpectedly");
             }
         } catch (const std::exception& ex) {
-            LOG_FATAL(dctl_logger, DHCP_DDNS_FAILED).arg(ex.what());
+            LOG_FATAL(d2_logger, DHCP_DDNS_FAILED).arg(ex.what());
             isc_throw (DProcessBaseError,
                        "Process run method failed: " << ex.what());
         }
@@ -78,7 +78,7 @@ D2Process::run() {
     // this might be the place to do it, once there is a persistence mgr.
     // This may also be better in checkQueueStatus.
 
-    LOG_DEBUG(dctl_logger, DBGLVL_START_SHUT, DHCP_DDNS_RUN_EXIT);
+    LOG_DEBUG(d2_logger, DBGLVL_START_SHUT, DHCP_DDNS_RUN_EXIT);
 
 };
 
@@ -145,7 +145,7 @@ D2Process::canShutdown() const {
         }
 
         if (all_clear) {
-            LOG_DEBUG(dctl_logger, DBGLVL_START_SHUT,
+            LOG_DEBUG(d2_logger, DBGLVL_START_SHUT,
                      DHCP_DDNS_CLEARED_FOR_SHUTDOWN)
                      .arg(getShutdownTypeStr(shutdown_type_));
         }
@@ -156,7 +156,7 @@ D2Process::canShutdown() const {
 
 isc::data::ConstElementPtr
 D2Process::shutdown(isc::data::ConstElementPtr args) {
-    LOG_DEBUG(dctl_logger, DBGLVL_START_SHUT, DHCP_DDNS_SHUTDOWN_COMMAND)
+    LOG_DEBUG(d2_logger, DBGLVL_START_SHUT, DHCP_DDNS_SHUTDOWN_COMMAND)
               .arg(args ? args->str() : "(no arguments)");
 
     // Default shutdown type is normal.
@@ -190,7 +190,7 @@ D2Process::shutdown(isc::data::ConstElementPtr args) {
 
 isc::data::ConstElementPtr
 D2Process::configure(isc::data::ConstElementPtr config_set) {
-    LOG_DEBUG(dctl_logger, DBGLVL_TRACE_BASIC,
+    LOG_DEBUG(d2_logger, DBGLVL_TRACE_BASIC,
               DHCP_DDNS_CONFIGURE).arg(config_set->str());
 
     int rcode = 0;
@@ -235,7 +235,7 @@ D2Process::checkQueueStatus() {
             // canceling active listening which may generate an IO event, so
             // instigate the stop and get out.
             try {
-                LOG_DEBUG(dctl_logger, DBGLVL_START_SHUT,
+                LOG_DEBUG(d2_logger, DBGLVL_START_SHUT,
                           DHCP_DDNS_QUEUE_MGR_STOPPING)
                          .arg(reconf_queue_flag_ ? "reconfiguration"
                                                  : "shutdown");
@@ -243,7 +243,7 @@ D2Process::checkQueueStatus() {
             } catch (const isc::Exception& ex) {
                 // It is very unlikey that we would experience an error
                 // here, but theoretically possible.
-                LOG_ERROR(dctl_logger, DHCP_DDNS_QUEUE_MGR_STOP_ERROR)
+                LOG_ERROR(d2_logger, DHCP_DDNS_QUEUE_MGR_STOP_ERROR)
                           .arg(ex.what());
             }
         }
@@ -256,12 +256,12 @@ D2Process::checkQueueStatus() {
             size_t threshold = (((queue_mgr_->getMaxQueueSize()
                                 * QUEUE_RESTART_PERCENT)) / 100);
             if (queue_mgr_->getQueueSize() <= threshold) {
-                LOG_INFO (dctl_logger, DHCP_DDNS_QUEUE_MGR_RESUMING)
+                LOG_INFO (d2_logger, DHCP_DDNS_QUEUE_MGR_RESUMING)
                           .arg(threshold).arg(queue_mgr_->getMaxQueueSize());
                 try {
                     queue_mgr_->startListening();
                 } catch (const isc::Exception& ex) {
-                    LOG_ERROR(dctl_logger, DHCP_DDNS_QUEUE_MGR_RESUME_ERROR)
+                    LOG_ERROR(d2_logger, DHCP_DDNS_QUEUE_MGR_RESUME_ERROR)
                               .arg(ex.what());
                 }
             }
@@ -278,7 +278,7 @@ D2Process::checkQueueStatus() {
         // to keep from endlessly retrying over and over, with little time
         // in between.
         if (!shouldShutdown()) {
-            LOG_INFO (dctl_logger, DHCP_DDNS_QUEUE_MGR_RECOVERING);
+            LOG_INFO (d2_logger, DHCP_DDNS_QUEUE_MGR_RECOVERING);
             reconfigureQueueMgr();
         }
         break;
@@ -295,7 +295,7 @@ D2Process::checkQueueStatus() {
         // we can do the reconfigure. In other words, we aren't RUNNING or
         // STOPPING.
         if (reconf_queue_flag_) {
-            LOG_DEBUG(dctl_logger, DBGLVL_TRACE_BASIC,
+            LOG_DEBUG(d2_logger, DBGLVL_TRACE_BASIC,
                       DHCP_DDNS_QUEUE_MGR_RECONFIGURING);
             reconfigureQueueMgr();
         }
@@ -326,7 +326,7 @@ D2Process::reconfigureQueueMgr() {
         /// @todo Remove this once we provide a secure mechanism.
         std::string ip_address =  d2_params->getIpAddress().toText();
         if (ip_address != "127.0.0.1" && ip_address != "::1") {
-            LOG_WARN(dctl_logger, DHCP_DDNS_NOT_ON_LOOPBACK).arg(ip_address);
+            LOG_WARN(d2_logger, DHCP_DDNS_NOT_ON_LOOPBACK).arg(ip_address);
         }
 
         // Instantiate the listener.
@@ -350,7 +350,7 @@ D2Process::reconfigureQueueMgr() {
         // Queue manager failed to initialize and therefore not listening.
         // This is most likely due to an unavailable IP address or port,
         // which is a configuration issue.
-        LOG_ERROR(dctl_logger, DHCP_DDNS_QUEUE_MGR_START_ERROR).arg(ex.what());
+        LOG_ERROR(d2_logger, DHCP_DDNS_QUEUE_MGR_START_ERROR).arg(ex.what());
     }
 }
 
@@ -360,7 +360,7 @@ D2Process::command(const std::string& command,
     // @todo This is the initial implementation.  If and when D2 is extended
     // to support its own commands, this implementation must change. Otherwise
     // it should reject all commands as it does now.
-    LOG_DEBUG(dctl_logger, DBGLVL_TRACE_BASIC, DHCP_DDNS_COMMAND)
+    LOG_DEBUG(d2_logger, DBGLVL_TRACE_BASIC, DHCP_DDNS_COMMAND)
         .arg(command).arg(args ? args->str() : "(no args)");
 
     return (isc::config::createAnswer(COMMAND_INVALID, "Unrecognized command: "
index 15ea96e04e743cb1fb29d65c5d0c033c4d45533b..ba9676df713ef643ff7969809200fbf1542438da 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -137,7 +137,7 @@ D2QueueMgr::startListening() {
                   << ex.what());
     }
 
-    LOG_DEBUG(dctl_logger, DBGLVL_START_SHUT, DHCP_DDNS_QUEUE_MGR_STARTED);
+    LOG_DEBUG(d2_logger, DBGLVL_START_SHUT, DHCP_DDNS_QUEUE_MGR_STARTED);
 }
 
 void
@@ -172,7 +172,7 @@ D2QueueMgr::stopListening(const State target_stop_state) {
 void
 D2QueueMgr::updateStopState() {
     mgr_state_ = target_stop_state_;
-    LOG_DEBUG(dctl_logger, DBGLVL_TRACE_BASIC, DHCP_DDNS_QUEUE_MGR_STOPPED);
+    LOG_DEBUG(d2_logger, DBGLVL_TRACE_BASIC, DHCP_DDNS_QUEUE_MGR_STOPPED);
 }
 
 
index 04eb4a30b9509ecfde8f71248c6de0d5de5f0666..58a3639e80892d0760125fa3369e35caf2ce3b07 100644 (file)
@@ -36,9 +36,9 @@ EXTRA_DIST = process_messages.mes
 CLEANFILES = *.gcno *.gcda spec_config.h process_messages.h process_messages.cc s-messages
 
 lib_LTLIBRARIES = libkea-process.la
-libkea_process_la_SOURCES  = d2_log.cc d2_log.h
-libkea_process_la_SOURCES += d_cfg_mgr.cc d_cfg_mgr.h
+libkea_process_la_SOURCES  = d_cfg_mgr.cc d_cfg_mgr.h
 libkea_process_la_SOURCES += d_controller.cc d_controller.h
+libkea_process_la_SOURCES += d_log.cc d_log.h
 libkea_process_la_SOURCES += d_process.h
 libkea_process_la_SOURCES += io_service_signal.cc io_service_signal.h
 
@@ -65,7 +65,7 @@ libkea_process_la_LIBADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS)
 # Specify the headers for copying into the installation directory tree.
 libkea_process_includedir = $(pkgincludedir)/process
 libkea_process_include_HEADERS = \
-       d2_log.h \
+       d_log.h \
        d_cfg_mgr.h \
        d_controller.h \
        d_process.h \
index b401512369752b78b6f25c2559b2bb55e92848eb..478d9b597e38c61ac1a95952667722eec861a54d 100644 (file)
@@ -9,7 +9,7 @@
 #include <cc/command_interpreter.h>
 #include <dhcp/libdhcp++.h>
 #include <dhcpsrv/parsers/dhcp_parsers.h>
-#include <process/d2_log.h>
+#include <process/d_log.h>
 #include <process/d_cfg_mgr.h>
 #include <util/encode/hex.h>
 #include <util/strutil.h>
index a775babf61682e46f79d85b649a23d6183f6eefb..53ccc311423726076dc27c153f21f6f779a35bce 100644 (file)
@@ -12,7 +12,7 @@
 #include <exceptions/exceptions.h>
 #include <log/logger.h>
 #include <log/logger_support.h>
-#include <process/d2_log.h>
+#include <process/d_log.h>
 #include <process/d_controller.h>
 
 #ifdef HAVE_MYSQL
index 071ab7a29f69e4eb43bb19bce0a886ed47d4eeab..92a8001461dc9ce33973ce060f815e4fcf007f5f 100644 (file)
@@ -12,7 +12,7 @@
 #include <dhcpsrv/daemon.h>
 #include <exceptions/exceptions.h>
 #include <log/logger_support.h>
-#include <process/d2_log.h>
+#include <process/d_log.h>
 #include <process/d_process.h>
 #include <process/io_service_signal.h>
 
similarity index 87%
rename from src/lib/process/d2_log.cc
rename to src/lib/process/d_log.cc
index 456b84c0fd03dd6e724cd45aed8fbbe57e7329f4..06eec6e35ecf9fd4c9f131d20c4613a6fc7c6039 100644 (file)
@@ -6,13 +6,13 @@
 
 /// Defines the logger used by the top-level component of kea-dhcp-ddns.
 
-#include <process/d2_log.h>
+#include <process/d_log.h>
 
 namespace isc {
 namespace d2 {
 
 /// @brief Defines the logger used within libkea-process library.
-isc::log::Logger dctl_logger("dhcpddns");
+isc::log::Logger dctl_logger("dctl");
 
 } // namespace d2
 } // namespace isc
index 98c3309fb394518fb69268dbb2bdd2259cd5f980..04b0609b7496e8723ef2a7f54fa59d4ea50e8990 100644 (file)
@@ -5,7 +5,7 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <asiolink/interval_timer.h>
-#include <process/d2_log.h>
+#include <process/d_log.h>
 #include <process/io_service_signal.h>
 
 namespace isc {
index eb910ae29bccf9d65b0f73180e1db83cbebb1833..e970ed5d68088f39e4f7f44b68c002e7251fcebb 100644 (file)
@@ -5,7 +5,7 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <log/logger_support.h>
-#include <process/d2_log.h>
+#include <process/d_log.h>
 #include <gtest/gtest.h>
 
 int
index 2fa9171c851d28a43bf36e8599763fb3593598cb..e1e8ea7599a92422f7a7f589421612187e4cb587 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <config.h>
 #include <asiolink/io_service.h>
-#include <process/d2_log.h>
+#include <process/d_log.h>
 #include <process/spec_config.h>
 #include <process/testutils/d_test_stubs.h>