Browse Source

[5074] Rename d2_logger to dctl_logger in libkea-process.

Marcin Siodelski 8 years ago
parent
commit
070672ba4e

+ 9 - 3
doc/guide/logging.xml

@@ -441,10 +441,16 @@
 
           <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>
 

+ 2 - 2
src/bin/d2/d2_log.cc

@@ -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");
 

+ 1 - 1
src/bin/d2/d2_log.h

@@ -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;
 

+ 15 - 15
src/bin/d2/d2_process.cc

@@ -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: "

+ 3 - 3
src/bin/d2/d2_queue_mgr.cc

@@ -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);
 }
 
 

+ 3 - 3
src/lib/process/Makefile.am

@@ -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 \

+ 1 - 1
src/lib/process/d_cfg_mgr.cc

@@ -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>

+ 1 - 1
src/lib/process/d_controller.cc

@@ -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

+ 1 - 1
src/lib/process/d_controller.h

@@ -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>
 

+ 2 - 2
src/lib/process/d2_log.cc

@@ -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

src/lib/process/d2_log.h → src/lib/process/d_log.h


+ 1 - 1
src/lib/process/io_service_signal.cc

@@ -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 {

+ 1 - 1
src/lib/process/tests/run_unittests.cc

@@ -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

+ 1 - 1
src/lib/process/testutils/d_test_stubs.cc

@@ -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>