Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Adam Osuchowski
Kea
Commits
070672ba
Commit
070672ba
authored
Dec 01, 2016
by
Marcin Siodelski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[5074] Rename d2_logger to dctl_logger in libkea-process.
parent
db92b54d
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
41 additions
and
35 deletions
+41
-35
doc/guide/logging.xml
doc/guide/logging.xml
+9
-3
src/bin/d2/d2_log.cc
src/bin/d2/d2_log.cc
+2
-2
src/bin/d2/d2_log.h
src/bin/d2/d2_log.h
+1
-1
src/bin/d2/d2_process.cc
src/bin/d2/d2_process.cc
+15
-15
src/bin/d2/d2_queue_mgr.cc
src/bin/d2/d2_queue_mgr.cc
+3
-3
src/lib/process/Makefile.am
src/lib/process/Makefile.am
+3
-3
src/lib/process/d_cfg_mgr.cc
src/lib/process/d_cfg_mgr.cc
+1
-1
src/lib/process/d_controller.cc
src/lib/process/d_controller.cc
+1
-1
src/lib/process/d_controller.h
src/lib/process/d_controller.h
+1
-1
src/lib/process/d_log.cc
src/lib/process/d_log.cc
+2
-2
src/lib/process/d_log.h
src/lib/process/d_log.h
+0
-0
src/lib/process/io_service_signal.cc
src/lib/process/io_service_signal.cc
+1
-1
src/lib/process/tests/run_unittests.cc
src/lib/process/tests/run_unittests.cc
+1
-1
src/lib/process/testutils/d_test_stubs.cc
src/lib/process/testutils/d_test_stubs.cc
+1
-1
No files found.
doc/guide/logging.xml
View file @
070672ba
...
...
@@ -439,12 +439,18 @@
</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>
...
...
src/bin/d2/d2_log.cc
View file @
070672ba
// Copyright (C) 2013-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2013-201
6
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
d
ctl
_logger
(
"dhcpddns"
);
isc
::
log
::
Logger
d
2
_logger
(
"dhcpddns"
);
isc
::
log
::
Logger
dhcp_to_d2_logger
(
"dhcp-to-d2"
);
isc
::
log
::
Logger
d2_to_dns_logger
(
"d2-to-dns"
);
...
...
src/bin/d2/d2_log.h
View file @
070672ba
...
...
@@ -15,7 +15,7 @@ namespace isc {
namespace
d2
{
/// Define the loggers for the "d2" logging.
extern
isc
::
log
::
Logger
d
ctl
_logger
;
extern
isc
::
log
::
Logger
d
2
_logger
;
extern
isc
::
log
::
Logger
dhcp_to_d2_logger
;
extern
isc
::
log
::
Logger
d2_to_dns_logger
;
...
...
src/bin/d2/d2_process.cc
View file @
070672ba
...
...
@@ -42,7 +42,7 @@ D2Process::init() {
void
D2Process
::
run
()
{
LOG_INFO
(
d
ctl
_logger
,
DHCP_DDNS_STARTED
).
arg
(
VERSION
);
LOG_INFO
(
d
2
_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
(
d
ctl
_logger
,
DHCP_DDNS_FAILED
).
arg
(
ex
.
what
());
LOG_FATAL
(
d
2
_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
(
d
ctl
_logger
,
DBGLVL_START_SHUT
,
DHCP_DDNS_RUN_EXIT
);
LOG_DEBUG
(
d
2
_logger
,
DBGLVL_START_SHUT
,
DHCP_DDNS_RUN_EXIT
);
};
...
...
@@ -145,7 +145,7 @@ D2Process::canShutdown() const {
}
if
(
all_clear
)
{
LOG_DEBUG
(
d
ctl
_logger
,
DBGLVL_START_SHUT
,
LOG_DEBUG
(
d
2
_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
(
d
ctl
_logger
,
DBGLVL_START_SHUT
,
DHCP_DDNS_SHUTDOWN_COMMAND
)
LOG_DEBUG
(
d
2
_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
(
d
ctl
_logger
,
DBGLVL_TRACE_BASIC
,
LOG_DEBUG
(
d
2
_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
(
d
ctl
_logger
,
DBGLVL_START_SHUT
,
LOG_DEBUG
(
d
2
_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
(
d
ctl
_logger
,
DHCP_DDNS_QUEUE_MGR_STOP_ERROR
)
LOG_ERROR
(
d
2
_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
(
d
ctl
_logger
,
DHCP_DDNS_QUEUE_MGR_RESUMING
)
LOG_INFO
(
d
2
_logger
,
DHCP_DDNS_QUEUE_MGR_RESUMING
)
.
arg
(
threshold
).
arg
(
queue_mgr_
->
getMaxQueueSize
());
try
{
queue_mgr_
->
startListening
();
}
catch
(
const
isc
::
Exception
&
ex
)
{
LOG_ERROR
(
d
ctl
_logger
,
DHCP_DDNS_QUEUE_MGR_RESUME_ERROR
)
LOG_ERROR
(
d
2
_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
(
d
ctl
_logger
,
DHCP_DDNS_QUEUE_MGR_RECOVERING
);
LOG_INFO
(
d
2
_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
(
d
ctl
_logger
,
DBGLVL_TRACE_BASIC
,
LOG_DEBUG
(
d
2
_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
(
d
ctl
_logger
,
DHCP_DDNS_NOT_ON_LOOPBACK
).
arg
(
ip_address
);
LOG_WARN
(
d
2
_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
(
d
ctl
_logger
,
DHCP_DDNS_QUEUE_MGR_START_ERROR
).
arg
(
ex
.
what
());
LOG_ERROR
(
d
2
_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
(
d
ctl
_logger
,
DBGLVL_TRACE_BASIC
,
DHCP_DDNS_COMMAND
)
LOG_DEBUG
(
d
2
_logger
,
DBGLVL_TRACE_BASIC
,
DHCP_DDNS_COMMAND
)
.
arg
(
command
).
arg
(
args
?
args
->
str
()
:
"(no args)"
);
return
(
isc
::
config
::
createAnswer
(
COMMAND_INVALID
,
"Unrecognized command: "
...
...
src/bin/d2/d2_queue_mgr.cc
View file @
070672ba
// Copyright (C) 2013-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2013-201
6
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
(
d
ctl
_logger
,
DBGLVL_START_SHUT
,
DHCP_DDNS_QUEUE_MGR_STARTED
);
LOG_DEBUG
(
d
2
_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
(
d
ctl
_logger
,
DBGLVL_TRACE_BASIC
,
DHCP_DDNS_QUEUE_MGR_STOPPED
);
LOG_DEBUG
(
d
2
_logger
,
DBGLVL_TRACE_BASIC
,
DHCP_DDNS_QUEUE_MGR_STOPPED
);
}
...
...
src/lib/process/Makefile.am
View file @
070672ba
...
...
@@ -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
=
\
d
2
_log.h
\
d_log.h
\
d_cfg_mgr.h
\
d_controller.h
\
d_process.h
\
...
...
src/lib/process/d_cfg_mgr.cc
View file @
070672ba
...
...
@@ -9,7 +9,7 @@
#include <cc/command_interpreter.h>
#include <dhcp/libdhcp++.h>
#include <dhcpsrv/parsers/dhcp_parsers.h>
#include <process/d
2
_log.h>
#include <process/d_log.h>
#include <process/d_cfg_mgr.h>
#include <util/encode/hex.h>
#include <util/strutil.h>
...
...
src/lib/process/d_controller.cc
View file @
070672ba
...
...
@@ -12,7 +12,7 @@
#include <exceptions/exceptions.h>
#include <log/logger.h>
#include <log/logger_support.h>
#include <process/d
2
_log.h>
#include <process/d_log.h>
#include <process/d_controller.h>
#ifdef HAVE_MYSQL
...
...
src/lib/process/d_controller.h
View file @
070672ba
...
...
@@ -12,7 +12,7 @@
#include <dhcpsrv/daemon.h>
#include <exceptions/exceptions.h>
#include <log/logger_support.h>
#include <process/d
2
_log.h>
#include <process/d_log.h>
#include <process/d_process.h>
#include <process/io_service_signal.h>
...
...
src/lib/process/d
2
_log.cc
→
src/lib/process/d_log.cc
View file @
070672ba
...
...
@@ -6,13 +6,13 @@
/// Defines the logger used by the top-level component of kea-dhcp-ddns.
#include <process/d
2
_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
(
"d
hcpddns
"
);
isc
::
log
::
Logger
dctl_logger
(
"d
ctl
"
);
}
// namespace d2
}
// namespace isc
...
...
src/lib/process/d
2
_log.h
→
src/lib/process/d_log.h
View file @
070672ba
File moved
src/lib/process/io_service_signal.cc
View file @
070672ba
...
...
@@ -5,7 +5,7 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <asiolink/interval_timer.h>
#include <process/d
2
_log.h>
#include <process/d_log.h>
#include <process/io_service_signal.h>
namespace
isc
{
...
...
src/lib/process/tests/run_unittests.cc
View file @
070672ba
...
...
@@ -5,7 +5,7 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <log/logger_support.h>
#include <process/d
2
_log.h>
#include <process/d_log.h>
#include <gtest/gtest.h>
int
...
...
src/lib/process/testutils/d_test_stubs.cc
View file @
070672ba
...
...
@@ -6,7 +6,7 @@
#include <config.h>
#include <asiolink/io_service.h>
#include <process/d
2
_log.h>
#include <process/d_log.h>
#include <process/spec_config.h>
#include <process/testutils/d_test_stubs.h>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment