Commit 2becffcd authored by Shawn Routhier's avatar Shawn Routhier

[trac3808] Enhance logging for D2

Split the logging into three loggers
 config & general
 dhcp to d2
 d2 to dns (and back)

Print out a request ID for each NCR event.  Currently this is the
DHCID but it could be changed in the future to allow for comparing
log entries between DHCP servers and D2.

Fix up some typos I ran across while reading the code
parent 39167c04
......@@ -231,9 +231,23 @@
</listitem>
<listitem>
<simpara><command>kea-dhcp-ddns.dhcpddns</command> - this is the logger
used solely by the kea-dhcp-ddns deamon. This logger does not
specify logging settings for libraries used by the deamon.</simpara>
used by the kea-dhcp-ddns deamon for logging configuration and global
event information. This logger does not specify logging settings
for libraries used by the deamon.</simpara>
</listitem>
<listitem>
<simpara><command>kea-dhcp-ddns.dhcp_to_d2</command> - this is the logger
used by the kea-dhcp-ddns deamon for logging information about events
dealing with receving messages from the DHCP servers and adding them
to the queue for processing.</simpara>
</listitem>
<listitem>
<simpara><command>kea-dhcp-ddns.d2_to_dns</command> - this is the logger
used by the kea-dhcp-ddns deamon for logging information about events
dealing with sending and receiving messages with the DNS servers.
</simpara>
</listitem>
</itemizedlist>
<para>Additional loggers may be defined in the future. The easiest
......
......@@ -134,7 +134,7 @@ public:
return (boost::dynamic_pointer_cast<D2CfgContext>(getContext()));
}
/// @brief Returns whether not forward updates are enabled.
/// @brief Returns whether or not forward updates are enabled.
///
/// This method currently uses the presence or absence of Foward DDNS
/// Domains to determine if forward updates are enabled or disabled.
......@@ -144,7 +144,7 @@ public:
/// @return true if forward updates are enabled, false otherwise.
bool forwardUpdatesEnabled();
/// @brief Returns whether not reverse updates are enabled.
/// @brief Returns whether or not reverse updates are enabled.
///
/// This method currently uses the presence or absence of Reverse DDNS
/// Domains to determine if reverse updates are enabled or disabled.
......
......@@ -330,7 +330,7 @@ DdnsDomainListMgr::matchDomain(const std::string& fqdn, DdnsDomainPtr& domain) {
return (true);
}
LOG_WARN(dctl_logger, DHCP_DDNS_NO_MATCH).arg(fqdn);
LOG_WARN(dhcp_to_d2_logger, DHCP_DDNS_NO_MATCH).arg(fqdn);
return (false);
}
......
......@@ -70,7 +70,7 @@ namespace d2 {
/// any scalars which belong to the manager as well as creating and invoking a
/// DdnsDomainListParser to parse its list of domain entries.
///
/// A DdnsDomainListParser creates and invokes DdnsDomainListParser for each
/// A DdnsDomainListParser creates and invokes a DdnsDomainParser for each
/// domain entry in its list.
///
/// A DdnsDomainParser handles the scalars which belong to the domain as well as
......
// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2013, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -21,6 +21,8 @@ namespace d2 {
/// @brief Defines the logger used within D2.
isc::log::Logger dctl_logger("dhcpddns");
isc::log::Logger dhcp_to_d2_logger("dchp_to_d2");
isc::log::Logger d2_to_dns_logger("d2_to_dns");
} // namespace d2
} // namespace isc
......
// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2013, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -22,9 +22,10 @@
namespace isc {
namespace d2 {
/// Define the logger for the "d2" logging.
/// Define the loggers for the "d2" logging.
extern isc::log::Logger dctl_logger;
extern isc::log::Logger dhcp_to_d2_logger;
extern isc::log::Logger d2_to_dns_logger;
} // namespace d2
} // namespace isc
......
This diff is collapsed.
......@@ -319,7 +319,7 @@ D2Process::reconfigureQueueMgr() {
// a valid configuration to work with so if we fail below, it will be
// an operational issue, such as a busy IP address. That will leave
// queue manager in INITTED state, which is fine.
// What we dont' want is to continually attempt to reconfigure so set
// What we don't want is to continually attempt to reconfigure so set
// the flag false now.
// @todo This method assumes only 1 type of listener. This will change
// to support at least a TCP version, possibly some form of RDBMS listener
......
......@@ -65,7 +65,7 @@ public:
/// @param io_service is the io_service used by the caller for
/// asynchronous event handling.
///
/// @throw DProcessBaseError is io_service is NULL.
/// @throw DProcessBaseError if io_service is NULL.
D2Process(const char* name, const asiolink::IOServicePtr& io_service);
/// @brief Called after instantiation to perform initialization unique to
......@@ -86,7 +86,7 @@ public:
/// Once entered, the main control thread remains inside this method
/// until shutdown. The event loop logic is as follows:
/// @code
/// while should not down {
/// while should not shutdown {
/// process queue manager state change
/// process completed jobs
/// dequeue new jobs
......@@ -146,7 +146,7 @@ public:
///
/// This method may be called multiple times during the process lifetime.
/// Certainly once during process startup, and possibly later if the user
/// alters configuration. This method must not throw, it should catch any
/// alters the configuration. This method must not throw, it should catch any
/// processing errors and return a success or failure answer as described
/// below.
///
......@@ -217,7 +217,7 @@ protected:
/// @brief Initializes then starts the queue manager.
///
/// This method is initializes the queue manager with the current
/// This method initializes the queue manager with the current
/// configuration parameters and instructs it to start listening.
/// Note the existing listener instance (if it exists) is destroyed,
/// and that a new listener is created during initialization.
......
......@@ -54,13 +54,18 @@ D2QueueMgr::operator()(const dhcp_ddns::NameChangeListener::Result result,
if (getQueueSize() < getMaxQueueSize()) {
// There's room on the queue, add to the end
enqueue(ncr);
// Log that we got the request
LOG_DEBUG(dhcp_to_d2_logger, DBGLVL_TRACE_DETAIL_DATA,
DHCP_DDNS_QUEUE_MGR_QUEUE_RECEIVE)
.arg(ncr->getRequestId());
return;
}
// Queue is full, stop the listener.
// Note that we can move straight to a STOPPED state as there
// is no receive in progress.
LOG_ERROR(dctl_logger, DHCP_DDNS_QUEUE_MGR_QUEUE_FULL)
LOG_ERROR(dhcp_to_d2_logger, DHCP_DDNS_QUEUE_MGR_QUEUE_FULL)
.arg(max_queue_size_);
stopListening(STOPPED_QUEUE_FULL);
break;
......@@ -71,11 +76,11 @@ D2QueueMgr::operator()(const dhcp_ddns::NameChangeListener::Result result,
// callback will not be called again, unless its restarted.
updateStopState();
} else {
// We should not get an receive complete status of stopped
// We should not get a receive complete status of stopped
// unless we canceled the read as part of stopping. Therefore
// this is unexpected so we will treat it as a receive error.
// This is most likely an unforeseen programmatic issue.
LOG_ERROR(dctl_logger, DHCP_DDNS_QUEUE_MGR_UNEXPECTED_STOP)
LOG_ERROR(dhcp_to_d2_logger, DHCP_DDNS_QUEUE_MGR_UNEXPECTED_STOP)
.arg(mgr_state_);
stopListening(STOPPED_RECV_ERROR);
}
......@@ -86,13 +91,13 @@ D2QueueMgr::operator()(const dhcp_ddns::NameChangeListener::Result result,
// Receive failed, stop the listener.
// Note that we can move straight to a STOPPED state as there
// is no receive in progress.
LOG_ERROR(dctl_logger, DHCP_DDNS_QUEUE_MGR_RECV_ERROR);
LOG_ERROR(dhcp_to_d2_logger, DHCP_DDNS_QUEUE_MGR_RECV_ERROR);
stopListening(STOPPED_RECV_ERROR);
break;
}
} catch (const std::exception& ex) {
// On the outside chance a throw occurs, let's log it and swallow it.
LOG_ERROR(dctl_logger, DHCP_DDNS_QUEUE_MGR_UNEXPECTED_HANDLER_ERROR)
LOG_ERROR(dhcp_to_d2_logger, DHCP_DDNS_QUEUE_MGR_UNEXPECTED_HANDLER_ERROR)
.arg(ex.what());
}
}
......
......@@ -72,10 +72,10 @@ public:
/// @brief D2QueueMgr creates and manages a queue of DNS update requests.
///
/// D2QueueMgr is class specifically designed as an integral part of DHCP-DDNS.
/// D2QueueMgr is a class specifically designed as an integral part of DHCP-DDNS.
/// Its primary responsibility is to listen for NameChangeRequests from
/// DHCP-DDNS clients (e.g. DHCP servers) and queue them for processing. In
/// addition it may provide a number services to locate entries in the queue
/// addition it may provide a number of services to locate entries in the queue
/// such as by FQDN or DHCID. These services may eventually be used
/// for processing optimization. The initial implementation will support
/// simple FIFO access.
......
......@@ -64,7 +64,7 @@ void D2UpdateMgr::sweep() {
// frequently. It will likely achieve max transactions quickly on its own.
if (getQueueCount() > 0) {
if (getTransactionCount() >= max_transactions_) {
LOG_DEBUG(dctl_logger, DBGLVL_TRACE_DETAIL_DATA,
LOG_DEBUG(dhcp_to_d2_logger, DBGLVL_TRACE_DETAIL_DATA,
DHCP_DDNS_AT_MAX_TRANSACTIONS).arg(getQueueCount())
.arg(getMaxTransactions());
......@@ -118,7 +118,7 @@ void D2UpdateMgr::pickNextJob() {
// There were no eligible jobs. All of the current DHCIDs already have
// transactions pending.
LOG_DEBUG(dctl_logger, DBGLVL_TRACE_DETAIL_DATA, DHCP_DDNS_NO_ELIGIBLE_JOBS)
LOG_DEBUG(dhcp_to_d2_logger, DBGLVL_TRACE_DETAIL_DATA, DHCP_DDNS_NO_ELIGIBLE_JOBS)
.arg(getQueueCount()).arg(getTransactionCount());
}
......@@ -140,8 +140,10 @@ D2UpdateMgr::makeTransaction(dhcp_ddns::NameChangeRequestPtr& next_ncr) {
if (next_ncr->isForwardChange()) {
if (!cfg_mgr_->forwardUpdatesEnabled()) {
next_ncr->setForwardChange(false);
LOG_DEBUG(dctl_logger, DBGLVL_TRACE_DETAIL_DATA,
DHCP_DDNS_FWD_REQUEST_IGNORED).arg(next_ncr->toText());
LOG_DEBUG(dhcp_to_d2_logger, DBGLVL_TRACE_DETAIL_DATA,
DHCP_DDNS_FWD_REQUEST_IGNORED)
.arg(next_ncr->getRequestId())
.arg(next_ncr->toText());
} else {
bool matched = cfg_mgr_->matchForward(next_ncr->getFqdn(),
forward_domain);
......@@ -149,7 +151,8 @@ D2UpdateMgr::makeTransaction(dhcp_ddns::NameChangeRequestPtr& next_ncr) {
// out. This has the net affect of dropping the request on the
// floor.
if (!matched) {
LOG_ERROR(dctl_logger, DHCP_DDNS_NO_FWD_MATCH_ERROR)
LOG_ERROR(dhcp_to_d2_logger, DHCP_DDNS_NO_FWD_MATCH_ERROR)
.arg(next_ncr->getRequestId())
.arg(next_ncr->toText());
return;
}
......@@ -163,8 +166,10 @@ D2UpdateMgr::makeTransaction(dhcp_ddns::NameChangeRequestPtr& next_ncr) {
if (next_ncr->isReverseChange()) {
if (!cfg_mgr_->reverseUpdatesEnabled()) {
next_ncr->setReverseChange(false);
LOG_DEBUG(dctl_logger, DBGLVL_TRACE_DETAIL_DATA,
DHCP_DDNS_REV_REQUEST_IGNORED).arg(next_ncr->toText());
LOG_DEBUG(dhcp_to_d2_logger, DBGLVL_TRACE_DETAIL_DATA,
DHCP_DDNS_REV_REQUEST_IGNORED)
.arg(next_ncr->getRequestId())
.arg(next_ncr->toText());
} else {
bool matched = cfg_mgr_->matchReverse(next_ncr->getIpAddress(),
reverse_domain);
......@@ -172,7 +177,8 @@ D2UpdateMgr::makeTransaction(dhcp_ddns::NameChangeRequestPtr& next_ncr) {
// out. This has the net affect of dropping the request on the
// floor.
if (!matched) {
LOG_ERROR(dctl_logger, DHCP_DDNS_NO_REV_MATCH_ERROR)
LOG_ERROR(dhcp_to_d2_logger, DHCP_DDNS_NO_REV_MATCH_ERROR)
.arg(next_ncr->getRequestId())
.arg(next_ncr->toText());
return;
}
......@@ -184,8 +190,10 @@ D2UpdateMgr::makeTransaction(dhcp_ddns::NameChangeRequestPtr& next_ncr) {
// If there is nothing to actually do, then the request falls on the floor.
// Should we log this?
if (!direction_count) {
LOG_DEBUG(dctl_logger, DBGLVL_TRACE_DETAIL_DATA,
DHCP_DDNS_REQUEST_DROPPED).arg(next_ncr->toText());
LOG_DEBUG(dhcp_to_d2_logger, DBGLVL_TRACE_DETAIL_DATA,
DHCP_DDNS_REQUEST_DROPPED)
.arg(next_ncr->getRequestId())
.arg(next_ncr->toText());
return;
}
......
......@@ -49,7 +49,7 @@ typedef std::map<TransactionKey, NameChangeTransactionPtr> TransactionList;
///
/// D2UpdateMgr uses the services of D2QueueMgr to monitor the queue of
/// NameChangeRequests and select and dequeue requests for processing.
/// When request is dequeued for processing it is removed from the queue and
/// When a request is dequeued for processing it is removed from the queue and
/// wrapped in NameChangeTransaction and added to the D2UpdateMgr's list of
/// transactions.
///
......@@ -65,7 +65,7 @@ typedef std::map<TransactionKey, NameChangeTransactionPtr> TransactionList;
/// transactions complete, D2UpdateMgr removes them from the transaction list,
/// replacing them with new transactions.
///
/// D2UpdateMgr carries out each of the above steps, from with a method called
/// D2UpdateMgr carries out each of the above steps, with a method called
/// sweep(). This method is intended to be called as IO events complete.
/// The upper layer(s) are responsible for calling sweep in a timely and cyclic
/// manner.
......@@ -154,7 +154,7 @@ protected:
///
/// If updates in a given direction are disabled requests for updates in
/// that direction will be ignored. For example: If a request is received
/// which asks for updates both directions but only forward updates are
/// which asks for updates in both directions but only forward updates are
/// enabled; only the forward update will be attempted. Effectively, the
/// request will be treated as if it only asked for forward updates.
///
......
......@@ -289,7 +289,7 @@ void DCfgMgrBase::buildAndCommit(std::string& element_id,
// and store them in parser's local storage.
parser->build(value);
// Invoke the parser's commit method. This "writes" the the data
// Invoke the parser's commit method. This "writes" the data
// item(s) stored locally by the parser into the context. (Note that
// parsers are free to do more than update the context, but that is an
// nothing something we are concerned with here.)
......
......@@ -90,7 +90,6 @@ DControllerBase::launch(int argc, char* argv[], const bool test_mode) {
"Application Process initialization failed: " << ex.what());
}
LOG_DEBUG(dctl_logger, DBGLVL_START_SHUT, DCTL_STANDALONE).arg(app_name_);
// Step 3 is to load configuration from file.
......@@ -305,20 +304,20 @@ isc::data::ConstElementPtr
DControllerBase::executeCommand(const std::string& command,
isc::data::ConstElementPtr args) {
// Shutdown is universal. If its not that, then try it as
// an custom command supported by the derivation. If that
// a custom command supported by the derivation. If that
// doesn't pan out either, than send to it the application
// as it may be supported there.
isc::data::ConstElementPtr answer;
if (command.compare(SHUT_DOWN_COMMAND) == 0) {
answer = shutdownProcess(args);
} else {
// It wasn't shutdown, so may be a custom controller command.
// It wasn't shutdown, so it may be a custom controller command.
int rcode = 0;
answer = customControllerCommand(command, args);
isc::config::parseAnswer(rcode, answer);
if (rcode == COMMAND_INVALID)
{
// It wasn't controller command, so may be an application command.
// It wasn't a controller command, so it may be an application command.
answer = process_->command(command, args);
}
}
......
......@@ -244,7 +244,7 @@ protected:
/// any prefixing hyphen(s)
/// @param optarg is the argument value (if one) associated with the option
///
/// @return must return true if the option was valid, false is it is
/// @return must return true if the option was valid, false if it is
/// invalid. (Note the default implementation always returns false.)
virtual bool customOption(int option, char *optarg);
......@@ -305,12 +305,12 @@ protected:
/// -# SIGHUP - instigates reloading the configuration file
/// -# SIGINT - instigates a graceful shutdown
/// -# SIGTERM - instigates a graceful shutdown
/// If received any other signal, it will issue a debug statement and
/// If it receives any other signal, it will issue a debug statement and
/// discard it.
/// Derivations wishing to support additional signals could override this
/// method with one that: processes the signal if it is one of additional
/// signals, otherwise invoke this method (DControllerBase::processSignal())
/// with signal value.
/// with the signal value.
/// @todo Provide a convenient way for derivations to register additional
/// signals.
virtual void processSignal(int signum);
......@@ -370,7 +370,7 @@ protected:
/// @brief Processes the command line arguments. It is the first step
/// taken after the controller has been launched. It combines the stock
/// list of options with those returned by getCustomOpts(), and uses
/// cstdlib's getopt to loop through the command line. The stock options
/// cstdlib's getopt to loop through the command line.
/// It handles stock options directly, and passes any custom options into
/// the customOption method. Currently there are only two stock options
/// -c for specifying the configuration file, and -v for verbose logging.
......
......@@ -147,7 +147,7 @@ DNSClientImpl::operator()(asiodns::IOFetch::Result result) {
tsig_context_.get());
} catch (const isc::Exception& ex) {
status = DNSClient::INVALID_RESPONSE;
LOG_DEBUG(dctl_logger, DBGLVL_TRACE_DETAIL,
LOG_DEBUG(d2_to_dns_logger, DBGLVL_TRACE_DETAIL,
DHCP_DDNS_INVALID_RESPONSE).arg(ex.what());
}
......
......@@ -75,7 +75,7 @@ public:
/// @brief Callback for the @c DNSClient class.
///
/// This is is abstract class which represents the external callback for the
/// This is an abstract class which represents the external callback for the
/// @c DNSClient. Caller must implement this class and supply its instance
/// in the @c DNSClient constructor to get callbacks when the DNS Update
/// exchange is complete (@see @c DNSClient).
......
......@@ -37,7 +37,7 @@ public:
/// @brief Implements the concept of a constant value with a text label.
///
/// This class implements an association between an constant integer value
/// This class implements an association between a constant integer value
/// and a text label. It provides a single constructor, accessors for both
/// the value and label, and boolean operators which treat the value as
/// the "key" for comparisons. This allows them to be assembled into
......
......@@ -196,7 +196,8 @@ NameAddTransaction::addingFwdAddrsHandler() {
// While unlikely, the build might fail if we have invalid
// data. Should that be the case, we need to fail the
// transaction.
LOG_ERROR(dctl_logger, DHCP_DDNS_FORWARD_ADD_BUILD_FAILURE)
LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_ADD_BUILD_FAILURE)
.arg(getRequestId())
.arg(getNcr()->toText())
.arg(ex.what());
transition(PROCESS_TRANS_FAILED_ST, UPDATE_FAILED_EVT);
......@@ -233,7 +234,8 @@ NameAddTransaction::addingFwdAddrsHandler() {
// Per RFC4703 any other value means cease.
// If we get not authorized should we try the next server in
// the list? @todo This needs some discussion perhaps.
LOG_ERROR(dctl_logger, DHCP_DDNS_FORWARD_ADD_REJECTED)
LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_ADD_REJECTED)
.arg(getRequestId())
.arg(getCurrentServer()->toText())
.arg(getNcr()->getFqdn())
.arg(rcode.getCode());
......@@ -249,7 +251,8 @@ NameAddTransaction::addingFwdAddrsHandler() {
// to select the next server for a retry.
// @note For now we treat OTHER as an IO error like TIMEOUT. It
// is not entirely clear if this is accurate.
LOG_ERROR(dctl_logger, DHCP_DDNS_FORWARD_ADD_IO_ERROR)
LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_ADD_IO_ERROR)
.arg(getRequestId())
.arg(getNcr()->getFqdn())
.arg(getCurrentServer()->toText());
......@@ -259,7 +262,8 @@ NameAddTransaction::addingFwdAddrsHandler() {
case DNSClient::INVALID_RESPONSE:
// A response was received but was corrupt. Retry it like an IO
// error.
LOG_ERROR(dctl_logger, DHCP_DDNS_FORWARD_ADD_RESP_CORRUPT)
LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_ADD_RESP_CORRUPT)
.arg(getRequestId())
.arg(getCurrentServer()->toText())
.arg(getNcr()->getFqdn());
......@@ -269,7 +273,8 @@ NameAddTransaction::addingFwdAddrsHandler() {
default:
// Any other value and we will fail this transaction, something
// bigger is wrong.
LOG_ERROR(dctl_logger, DHCP_DDNS_FORWARD_ADD_BAD_DNSCLIENT_STATUS)
LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_ADD_BAD_DNSCLIENT_STATUS)
.arg(getRequestId())
.arg(getDnsUpdateStatus())
.arg(getNcr()->getFqdn())
.arg(getCurrentServer()->toText());
......@@ -307,7 +312,8 @@ NameAddTransaction::replacingFwdAddrsHandler() {
// While unlikely, the build might fail if we have invalid
// data. Should that be the case, we need to fail the
// transaction.
LOG_ERROR(dctl_logger, DHCP_DDNS_FORWARD_REPLACE_BUILD_FAILURE)
LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_REPLACE_BUILD_FAILURE)
.arg(getRequestId())
.arg(getNcr()->toText())
.arg(ex.what());
transition(PROCESS_TRANS_FAILED_ST, UPDATE_FAILED_EVT);
......@@ -345,7 +351,8 @@ NameAddTransaction::replacingFwdAddrsHandler() {
// Per RFC4703 any other value means cease.
// If we get not authorized should try the next server in
// the list? @todo This needs some discussion perhaps.
LOG_ERROR(dctl_logger, DHCP_DDNS_FORWARD_REPLACE_REJECTED)
LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_REPLACE_REJECTED)
.arg(getRequestId())
.arg(getCurrentServer()->toText())
.arg(getNcr()->getFqdn())
.arg(rcode.getCode());
......@@ -361,7 +368,8 @@ NameAddTransaction::replacingFwdAddrsHandler() {
// to select the next server for a retry.
// @note For now we treat OTHER as an IO error like TIMEOUT. It
// is not entirely clear if this is accurate.
LOG_ERROR(dctl_logger, DHCP_DDNS_FORWARD_REPLACE_IO_ERROR)
LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_REPLACE_IO_ERROR)
.arg(getRequestId())
.arg(getNcr()->getFqdn())
.arg(getCurrentServer()->toText());
......@@ -373,7 +381,8 @@ NameAddTransaction::replacingFwdAddrsHandler() {
case DNSClient::INVALID_RESPONSE:
// A response was received but was corrupt. Retry it like an IO
// error.
LOG_ERROR(dctl_logger, DHCP_DDNS_FORWARD_REPLACE_RESP_CORRUPT)
LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_REPLACE_RESP_CORRUPT)
.arg(getRequestId())
.arg(getCurrentServer()->toText())
.arg(getNcr()->getFqdn());
......@@ -385,8 +394,9 @@ NameAddTransaction::replacingFwdAddrsHandler() {
default:
// Any other value and we will fail this transaction, something
// bigger is wrong.
LOG_ERROR(dctl_logger,
LOG_ERROR(d2_to_dns_logger,
DHCP_DDNS_FORWARD_REPLACE_BAD_DNSCLIENT_STATUS)
.arg(getRequestId())
.arg(getDnsUpdateStatus())
.arg(getNcr()->getFqdn())
.arg(getCurrentServer()->toText());
......@@ -453,7 +463,8 @@ NameAddTransaction::replacingRevPtrsHandler() {
// While unlikely, the build might fail if we have invalid
// data. Should that be the case, we need to fail the
// transaction.
LOG_ERROR(dctl_logger, DHCP_DDNS_REVERSE_REPLACE_BUILD_FAILURE)
LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_REVERSE_REPLACE_BUILD_FAILURE)
.arg(getRequestId())
.arg(getNcr()->toText())
.arg(ex.what());
transition(PROCESS_TRANS_FAILED_ST, UPDATE_FAILED_EVT);
......@@ -479,7 +490,8 @@ NameAddTransaction::replacingRevPtrsHandler() {
// Per RFC4703 any other value means cease.
// If we get not authorized should try the next server in
// the list? @todo This needs some discussion perhaps.
LOG_ERROR(dctl_logger, DHCP_DDNS_REVERSE_REPLACE_REJECTED)
LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_REVERSE_REPLACE_REJECTED)
.arg(getRequestId())
.arg(getCurrentServer()->toText())
.arg(getNcr()->getFqdn())
.arg(rcode.getCode());
......@@ -495,7 +507,8 @@ NameAddTransaction::replacingRevPtrsHandler() {
// to select the next server for a retry.
// @note For now we treat OTHER as an IO error like TIMEOUT. It
// is not entirely clear if this is accurate.
LOG_ERROR(dctl_logger, DHCP_DDNS_REVERSE_REPLACE_IO_ERROR)
LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_REVERSE_REPLACE_IO_ERROR)
.arg(getRequestId())
.arg(getNcr()->getFqdn())
.arg(getCurrentServer()->toText());
......@@ -507,7 +520,8 @@ NameAddTransaction::replacingRevPtrsHandler() {
case DNSClient::INVALID_RESPONSE:
// A response was received but was corrupt. Retry it like an IO
// error.
LOG_ERROR(dctl_logger, DHCP_DDNS_REVERSE_REPLACE_RESP_CORRUPT)
LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_REVERSE_REPLACE_RESP_CORRUPT)
.arg(getRequestId())
.arg(getCurrentServer()->toText())
.arg(getNcr()->getFqdn());
......@@ -519,8 +533,9 @@ NameAddTransaction::replacingRevPtrsHandler() {
default:
// Any other value and we will fail this transaction, something
// bigger is wrong.
LOG_ERROR(dctl_logger,
LOG_ERROR(d2_to_dns_logger,
DHCP_DDNS_REVERSE_REPLACE_BAD_DNSCLIENT_STATUS)
.arg(getRequestId())
.arg(getDnsUpdateStatus())
.arg(getNcr()->getFqdn())
.arg(getCurrentServer()->toText());
......@@ -543,8 +558,9 @@ void
NameAddTransaction::processAddOkHandler() {
switch(getNextEvent()) {
case UPDATE_OK_EVT:
LOG_INFO(dctl_logger, DHCP_DDNS_ADD_SUCCEEDED)
.arg(getNcr()->toText());
LOG_INFO(d2_to_dns_logger, DHCP_DDNS_ADD_SUCCEEDED)
.arg(getRequestId())
.arg(getNcr()->toText());
setNcrStatus(dhcp_ddns::ST_COMPLETED);
endModel();
break;
......@@ -561,7 +577,8 @@ NameAddTransaction::processAddFailedHandler() {
case UPDATE_FAILED_EVT:
case NO_MORE_SERVERS_EVT:
setNcrStatus(dhcp_ddns::ST_FAILED);
LOG_ERROR(dctl_logger, DHCP_DDNS_ADD_FAILED)
LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_ADD_FAILED)
.arg(getRequestId())
.arg(transactionOutcomeString());
endModel();
break;
......
......@@ -200,8 +200,9 @@ NameRemoveTransaction::removingFwdAddrsHandler() {
// While unlikely, the build might fail if we have invalid
// data. Should that be the case, we need to fail the
// transaction.
LOG_ERROR(dctl_logger,
LOG_ERROR(d2_to_dns_logger,
DHCP_DDNS_FORWARD_REMOVE_ADDRS_BUILD_FAILURE)
.arg(getRequestId())
.arg(getNcr()->toText())
.arg(ex.what());
transition(PROCESS_TRANS_FAILED_ST, UPDATE_FAILED_EVT);
......@@ -230,7 +231,8 @@ NameRemoveTransaction::removingFwdAddrsHandler() {
// Per RFC4703 any other value means cease.
// If we get not authorized should we try the next server in
// the list? @todo This needs some discussion perhaps.
LOG_ERROR(dctl_logger, DHCP_DDNS_FORWARD_REMOVE_ADDRS_REJECTED)
LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_REMOVE_ADDRS_REJECTED)
.arg(getRequestId())
.arg(getCurrentServer()->toText())
.arg(getNcr()->getFqdn())
.arg(rcode.getCode());
......@@ -246,7 +248,8 @@ NameRemoveTransaction::removingFwdAddrsHandler() {
// to select the next server for a retry.
// @note For now we treat OTHER as an IO error like TIMEOUT. It
// is not entirely clear if this is accurate.
LOG_ERROR(dctl_logger, DHCP_DDNS_FORWARD_REMOVE_ADDRS_IO_ERROR)
LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_REMOVE_ADDRS_IO_ERROR)
.arg(getRequestId())
.arg(getNcr()->getFqdn())
.arg(getCurrentServer()->toText());
......@@ -256,7 +259,8 @@ NameRemoveTransaction::removingFwdAddrsHandler() {
case DNSClient::INVALID_RESPONSE:
// A response was received but was corrupt. Retry it like an IO
// error.
LOG_ERROR(dctl_logger, DHCP_DDNS_FORWARD_REMOVE_ADDRS_RESP_CORRUPT)
LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_REMOVE_ADDRS_RESP_CORRUPT)
.arg(getRequestId())
.arg(getCurrentServer()->toText())
.arg(getNcr()->getFqdn());
......@@ -266,8 +270,9 @@ NameRemoveTransaction::removingFwdAddrsHandler() {
default:
// Any other value and we will fail this transaction, something
// bigger is wrong.