Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
56fdf498
Commit
56fdf498
authored
Mar 17, 2017
by
Francis Dupont
Browse files
[2358a] Rebased and completed
parent
3188ae9a
Changes
20
Hide whitespace changes
Inline
Side-by-side
src/bin/agent/ca_process.cc
View file @
56fdf498
...
...
@@ -99,7 +99,7 @@ CtrlAgentProcess::run() {
"Process run method failed: "
<<
ex
.
what
());
}
LOG_DEBUG
(
agent_logger
,
DBGLVL_START_SHUT
,
CTRL_AGENT_RUN_EXIT
);
LOG_DEBUG
(
agent_logger
,
isc
::
log
::
DBGLVL_START_SHUT
,
CTRL_AGENT_RUN_EXIT
);
}
isc
::
data
::
ConstElementPtr
...
...
src/bin/d2/d2_process.cc
View file @
56fdf498
...
...
@@ -80,7 +80,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
(
d2_logger
,
DBGLVL_START_SHUT
,
DHCP_DDNS_RUN_EXIT
);
LOG_DEBUG
(
d2_logger
,
isc
::
log
::
DBGLVL_START_SHUT
,
DHCP_DDNS_RUN_EXIT
);
};
...
...
@@ -147,9 +147,9 @@ D2Process::canShutdown() const {
}
if
(
all_clear
)
{
LOG_DEBUG
(
d2_logger
,
DBGLVL_START_SHUT
,
LOG_DEBUG
(
d2_logger
,
isc
::
log
::
DBGLVL_START_SHUT
,
DHCP_DDNS_CLEARED_FOR_SHUTDOWN
)
.
arg
(
getShutdownTypeStr
(
shutdown_type_
));
.
arg
(
getShutdownTypeStr
(
shutdown_type_
));
}
}
...
...
@@ -158,8 +158,9 @@ D2Process::canShutdown() const {
isc
::
data
::
ConstElementPtr
D2Process
::
shutdown
(
isc
::
data
::
ConstElementPtr
args
)
{
LOG_DEBUG
(
d2_logger
,
DBGLVL_START_SHUT
,
DHCP_DDNS_SHUTDOWN_COMMAND
)
.
arg
(
args
?
args
->
str
()
:
"(no arguments)"
);
LOG_DEBUG
(
d2_logger
,
isc
::
log
::
DBGLVL_START_SHUT
,
DHCP_DDNS_SHUTDOWN_COMMAND
)
.
arg
(
args
?
args
->
str
()
:
"(no arguments)"
);
// Default shutdown type is normal.
std
::
string
type_str
(
getShutdownTypeStr
(
SD_NORMAL
));
...
...
@@ -192,7 +193,7 @@ D2Process::shutdown(isc::data::ConstElementPtr args) {
isc
::
data
::
ConstElementPtr
D2Process
::
configure
(
isc
::
data
::
ConstElementPtr
config_set
,
bool
check_only
)
{
LOG_DEBUG
(
d2_logger
,
DBGLVL_TRACE_BASIC
,
DHCP_DDNS_CONFIGURE
)
LOG_DEBUG
(
d2_logger
,
isc
::
log
::
DBGLVL_TRACE_BASIC
,
DHCP_DDNS_CONFIGURE
)
.
arg
(
check_only
?
"check"
:
"update"
)
.
arg
(
config_set
->
str
());
...
...
@@ -243,10 +244,9 @@ D2Process::checkQueueStatus() {
// canceling active listening which may generate an IO event, so
// instigate the stop and get out.
try
{
LOG_DEBUG
(
d2_logger
,
DBGLVL_START_SHUT
,
LOG_DEBUG
(
d2_logger
,
isc
::
log
::
DBGLVL_START_SHUT
,
DHCP_DDNS_QUEUE_MGR_STOPPING
)
.
arg
(
reconf_queue_flag_
?
"reconfiguration"
:
"shutdown"
);
.
arg
(
reconf_queue_flag_
?
"reconfiguration"
:
"shutdown"
);
queue_mgr_
->
stopListening
();
}
catch
(
const
isc
::
Exception
&
ex
)
{
// It is very unlikely that we would experience an error
...
...
@@ -303,7 +303,7 @@ D2Process::checkQueueStatus() {
// we can do the reconfigure. In other words, we aren't RUNNING or
// STOPPING.
if
(
reconf_queue_flag_
)
{
LOG_DEBUG
(
d2_logger
,
DBGLVL_TRACE_BASIC
,
LOG_DEBUG
(
d2_logger
,
isc
::
log
::
DBGLVL_TRACE_BASIC
,
DHCP_DDNS_QUEUE_MGR_RECONFIGURING
);
reconfigureQueueMgr
();
}
...
...
@@ -368,7 +368,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
(
d2_logger
,
DBGLVL_TRACE_BASIC
,
DHCP_DDNS_COMMAND
)
LOG_DEBUG
(
d2_logger
,
isc
::
log
::
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 @
56fdf498
...
...
@@ -48,7 +48,8 @@ D2QueueMgr::operator()(const dhcp_ddns::NameChangeListener::Result result,
enqueue
(
ncr
);
// Log that we got the request
LOG_DEBUG
(
dhcp_to_d2_logger
,
DBGLVL_TRACE_DETAIL_DATA
,
LOG_DEBUG
(
dhcp_to_d2_logger
,
isc
::
log
::
DBGLVL_TRACE_DETAIL_DATA
,
DHCP_DDNS_QUEUE_MGR_QUEUE_RECEIVE
)
.
arg
(
ncr
->
getRequestId
());
return
;
...
...
@@ -137,7 +138,8 @@ D2QueueMgr::startListening() {
<<
ex
.
what
());
}
LOG_DEBUG
(
d2_logger
,
DBGLVL_START_SHUT
,
DHCP_DDNS_QUEUE_MGR_STARTED
);
LOG_DEBUG
(
d2_logger
,
isc
::
log
::
DBGLVL_START_SHUT
,
DHCP_DDNS_QUEUE_MGR_STARTED
);
}
void
...
...
@@ -172,7 +174,8 @@ D2QueueMgr::stopListening(const State target_stop_state) {
void
D2QueueMgr
::
updateStopState
()
{
mgr_state_
=
target_stop_state_
;
LOG_DEBUG
(
d2_logger
,
DBGLVL_TRACE_BASIC
,
DHCP_DDNS_QUEUE_MGR_STOPPED
);
LOG_DEBUG
(
d2_logger
,
isc
::
log
::
DBGLVL_TRACE_BASIC
,
DHCP_DDNS_QUEUE_MGR_STOPPED
);
}
...
...
src/bin/d2/d2_update_mgr.cc
View file @
56fdf498
...
...
@@ -56,7 +56,7 @@ void D2UpdateMgr::sweep() {
// frequently. It will likely achieve max transactions quickly on its own.
if
(
getQueueCount
()
>
0
)
{
if
(
getTransactionCount
()
>=
max_transactions_
)
{
LOG_DEBUG
(
dhcp_to_d2_logger
,
DBGLVL_TRACE_DETAIL_DATA
,
LOG_DEBUG
(
dhcp_to_d2_logger
,
isc
::
log
::
DBGLVL_TRACE_DETAIL_DATA
,
DHCP_DDNS_AT_MAX_TRANSACTIONS
).
arg
(
getQueueCount
())
.
arg
(
getMaxTransactions
());
...
...
@@ -110,8 +110,9 @@ void D2UpdateMgr::pickNextJob() {
// There were no eligible jobs. All of the current DHCIDs already have
// transactions pending.
LOG_DEBUG
(
dhcp_to_d2_logger
,
DBGLVL_TRACE_DETAIL_DATA
,
DHCP_DDNS_NO_ELIGIBLE_JOBS
)
.
arg
(
getQueueCount
()).
arg
(
getTransactionCount
());
LOG_DEBUG
(
dhcp_to_d2_logger
,
isc
::
log
::
DBGLVL_TRACE_DETAIL_DATA
,
DHCP_DDNS_NO_ELIGIBLE_JOBS
)
.
arg
(
getQueueCount
()).
arg
(
getTransactionCount
());
}
void
...
...
@@ -132,7 +133,7 @@ D2UpdateMgr::makeTransaction(dhcp_ddns::NameChangeRequestPtr& next_ncr) {
if
(
next_ncr
->
isForwardChange
())
{
if
(
!
cfg_mgr_
->
forwardUpdatesEnabled
())
{
next_ncr
->
setForwardChange
(
false
);
LOG_DEBUG
(
dhcp_to_d2_logger
,
DBGLVL_TRACE_DETAIL_DATA
,
LOG_DEBUG
(
dhcp_to_d2_logger
,
isc
::
log
::
DBGLVL_TRACE_DETAIL_DATA
,
DHCP_DDNS_FWD_REQUEST_IGNORED
)
.
arg
(
next_ncr
->
getRequestId
())
.
arg
(
next_ncr
->
toText
());
...
...
@@ -158,7 +159,7 @@ D2UpdateMgr::makeTransaction(dhcp_ddns::NameChangeRequestPtr& next_ncr) {
if
(
next_ncr
->
isReverseChange
())
{
if
(
!
cfg_mgr_
->
reverseUpdatesEnabled
())
{
next_ncr
->
setReverseChange
(
false
);
LOG_DEBUG
(
dhcp_to_d2_logger
,
DBGLVL_TRACE_DETAIL_DATA
,
LOG_DEBUG
(
dhcp_to_d2_logger
,
isc
::
log
::
DBGLVL_TRACE_DETAIL_DATA
,
DHCP_DDNS_REV_REQUEST_IGNORED
)
.
arg
(
next_ncr
->
getRequestId
())
.
arg
(
next_ncr
->
toText
());
...
...
@@ -182,7 +183,7 @@ 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
(
dhcp_to_d2_logger
,
DBGLVL_TRACE_DETAIL_DATA
,
LOG_DEBUG
(
dhcp_to_d2_logger
,
isc
::
log
::
DBGLVL_TRACE_DETAIL_DATA
,
DHCP_DDNS_REQUEST_DROPPED
)
.
arg
(
next_ncr
->
getRequestId
())
.
arg
(
next_ncr
->
toText
());
...
...
src/bin/d2/dns_client.cc
View file @
56fdf498
...
...
@@ -139,7 +139,7 @@ DNSClientImpl::operator()(asiodns::IOFetch::Result result) {
tsig_context_
.
get
());
}
catch
(
const
isc
::
Exception
&
ex
)
{
status
=
DNSClient
::
INVALID_RESPONSE
;
LOG_DEBUG
(
d2_to_dns_logger
,
DBGLVL_TRACE_DETAIL
,
LOG_DEBUG
(
d2_to_dns_logger
,
isc
::
log
::
DBGLVL_TRACE_DETAIL
,
DHCP_DDNS_INVALID_RESPONSE
).
arg
(
ex
.
what
());
}
...
...
src/bin/d2/nc_trans.cc
View file @
56fdf498
...
...
@@ -83,7 +83,7 @@ NameChangeTransaction::~NameChangeTransaction(){
void
NameChangeTransaction
::
startTransaction
()
{
LOG_DEBUG
(
d2_to_dns_logger
,
DBGLVL_TRACE_DETAIL
,
LOG_DEBUG
(
d2_to_dns_logger
,
isc
::
log
::
DBGLVL_TRACE_DETAIL
,
DHCP_DDNS_STARTING_TRANSACTION
)
.
arg
(
getRequestId
());
...
...
@@ -98,7 +98,7 @@ NameChangeTransaction::operator()(DNSClient::Status status) {
// runModel is exception safe so we are good to call it here.
// It won't exit until we hit the next IO wait or the state model ends.
setDnsUpdateStatus
(
status
);
LOG_DEBUG
(
d2_to_dns_logger
,
DBGLVL_TRACE_DETAIL
,
LOG_DEBUG
(
d2_to_dns_logger
,
isc
::
log
::
DBGLVL_TRACE_DETAIL
,
DHCP_DDNS_UPDATE_RESPONSE_RECEIVED
)
.
arg
(
getRequestId
())
.
arg
(
current_server_
->
toText
())
...
...
@@ -177,7 +177,7 @@ NameChangeTransaction::sendUpdate(const std::string& comment) {
d2_params
->
getDnsServerTimeout
(),
tsig_key_
);
// Message is on its way, so the next event should be NOP_EVT.
postNextEvent
(
NOP_EVT
);
LOG_DEBUG
(
d2_to_dns_logger
,
DBGLVL_TRACE_DETAIL
,
LOG_DEBUG
(
d2_to_dns_logger
,
isc
::
log
::
DBGLVL_TRACE_DETAIL
,
DHCP_DDNS_UPDATE_REQUEST_SENT
)
.
arg
(
getRequestId
())
.
arg
(
comment
)
...
...
src/bin/dhcp4/dhcp4_log.h
View file @
56fdf498
// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2012-2015
,2017
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
...
...
@@ -21,19 +21,19 @@ namespace dhcp {
//@{
/// @brief Debug level used to log information during server startup.
const
int
DBG_DHCP4_START
=
DBGLVL_START_SHUT
;
const
int
DBG_DHCP4_START
=
isc
::
log
::
DBGLVL_START_SHUT
;
/// @brief Debug level used to log information during server shutdown.
const
int
DBG_DHCP4_SHUT
=
DBGLVL_START_SHUT
;
const
int
DBG_DHCP4_SHUT
=
isc
::
log
::
DBGLVL_START_SHUT
;
/// @brief Debug level used to log receiving commands.
const
int
DBG_DHCP4_COMMAND
=
DBGLVL_COMMAND
;
const
int
DBG_DHCP4_COMMAND
=
isc
::
log
::
DBGLVL_COMMAND
;
/// @brief Debug level used to trace basic operations within the code.
const
int
DBG_DHCP4_BASIC
=
DBGLVL_TRACE_BASIC
;
const
int
DBG_DHCP4_BASIC
=
isc
::
log
::
DBGLVL_TRACE_BASIC
;
/// @brief Debug level used to trace hook related operations
const
int
DBG_DHCP4_HOOKS
=
DBGLVL_TRACE_BASIC
;
const
int
DBG_DHCP4_HOOKS
=
isc
::
log
::
DBGLVL_TRACE_BASIC
;
/// @brief Debug level used to log the traces with some basic data.
///
...
...
@@ -42,7 +42,7 @@ const int DBG_DHCP4_HOOKS = DBGLVL_TRACE_BASIC;
/// more detailed information in cases when it is warranted and the
/// extraction of the data doesn't impact the server's performance
/// significantly.
const
int
DBG_DHCP4_BASIC_DATA
=
DBGLVL_TRACE_BASIC_DATA
;
const
int
DBG_DHCP4_BASIC_DATA
=
isc
::
log
::
DBGLVL_TRACE_BASIC_DATA
;
/// @brief Debug level used to trace detailed errors.
///
...
...
@@ -50,10 +50,10 @@ const int DBG_DHCP4_BASIC_DATA = DBGLVL_TRACE_BASIC_DATA;
/// packets. (These are not logged at severities of WARN or higher for fear
/// that a set of deliberately invalid packets set to the server could overwhelm
/// the logging.)
const
int
DBG_DHCP4_DETAIL
=
DBGLVL_TRACE_DETAIL
;
const
int
DBG_DHCP4_DETAIL
=
isc
::
log
::
DBGLVL_TRACE_DETAIL
;
/// @brief This level is used to log the contents of packets received and sent.
const
int
DBG_DHCP4_DETAIL_DATA
=
DBGLVL_TRACE_DETAIL_DATA
;
const
int
DBG_DHCP4_DETAIL_DATA
=
isc
::
log
::
DBGLVL_TRACE_DETAIL_DATA
;
//@}
...
...
src/bin/dhcp6/dhcp6_log.h
View file @
56fdf498
// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2012-2015
,2017
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
...
...
@@ -18,19 +18,19 @@ namespace dhcp {
//@{
/// @brief Debug level used to log information during server startup.
const
int
DBG_DHCP6_START
=
DBGLVL_START_SHUT
;
const
int
DBG_DHCP6_START
=
isc
::
log
::
DBGLVL_START_SHUT
;
/// @brief Debug level used to log information during server shutdown.
const
int
DBG_DHCP6_SHUT
=
DBGLVL_START_SHUT
;
const
int
DBG_DHCP6_SHUT
=
isc
::
log
::
DBGLVL_START_SHUT
;
/// @brief Debug level used to log receiving commands.
const
int
DBG_DHCP6_COMMAND
=
DBGLVL_COMMAND
;
const
int
DBG_DHCP6_COMMAND
=
isc
::
log
::
DBGLVL_COMMAND
;
/// @brief Debug level used to trace basic operations within the code.
const
int
DBG_DHCP6_BASIC
=
DBGLVL_TRACE_BASIC
;
const
int
DBG_DHCP6_BASIC
=
isc
::
log
::
DBGLVL_TRACE_BASIC
;
/// @brief Debug level used to trace hook related operations
const
int
DBG_DHCP6_HOOKS
=
DBGLVL_TRACE_BASIC
;
const
int
DBG_DHCP6_HOOKS
=
isc
::
log
::
DBGLVL_TRACE_BASIC
;
/// @brief Debug level used to log the traces with some basic data.
///
...
...
@@ -39,7 +39,7 @@ const int DBG_DHCP6_HOOKS = DBGLVL_TRACE_BASIC;
/// more detailed information in cases when it is warranted and the
/// extraction of the data doesn't impact the server's performance
/// significantly.
const
int
DBG_DHCP6_BASIC_DATA
=
DBGLVL_TRACE_BASIC_DATA
;
const
int
DBG_DHCP6_BASIC_DATA
=
isc
::
log
::
DBGLVL_TRACE_BASIC_DATA
;
/// @brief Debug level used to trace detailed errors.
///
...
...
@@ -47,10 +47,10 @@ const int DBG_DHCP6_BASIC_DATA = DBGLVL_TRACE_BASIC_DATA;
/// packets. (These are not logged at severities of WARN or higher for fear
/// that a set of deliberately invalid packets set to the server could overwhelm
/// the logging.)
const
int
DBG_DHCP6_DETAIL
=
DBGLVL_TRACE_DETAIL
;
const
int
DBG_DHCP6_DETAIL
=
isc
::
log
::
DBGLVL_TRACE_DETAIL
;
/// @brief This level is used to log the contents of packets received and sent.
const
int
DBG_DHCP6_DETAIL_DATA
=
DBGLVL_TRACE_DETAIL_DATA
;
const
int
DBG_DHCP6_DETAIL_DATA
=
isc
::
log
::
DBGLVL_TRACE_DETAIL_DATA
;
//@}
...
...
src/lib/config/config_log.h
View file @
56fdf498
// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2011-2015
,2017
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
...
...
@@ -21,7 +21,7 @@ namespace config {
extern
isc
::
log
::
Logger
command_logger
;
// Enumerate configuration elements as they are processed.
const
int
DBG_COMMAND
=
DBGLVL_COMMAND
;
const
int
DBG_COMMAND
=
isc
::
log
::
DBGLVL_COMMAND
;
}
// namespace config
}
// namespace isc
...
...
src/lib/dhcp_ddns/ncr_udp.cc
View file @
56fdf498
// Copyright (C) 2013-201
6
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2013-201
7
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
...
...
@@ -174,7 +174,7 @@ NameChangeUDPListener::receiveCompletionHandler(const bool successful,
if
(
error_code
.
value
()
==
boost
::
asio
::
error
::
operation_aborted
)
{
// A shutdown cancels all outstanding reads. For this reason,
// it can be an expected event, so log it as a debug message.
LOG_DEBUG
(
dhcp_ddns_logger
,
DBGLVL_TRACE_BASIC
,
LOG_DEBUG
(
dhcp_ddns_logger
,
isc
::
log
::
DBGLVL_TRACE_BASIC
,
DHCP_DDNS_NCR_UDP_RECV_CANCELED
);
result
=
STOPPED
;
}
else
{
...
...
src/lib/dhcpsrv/alloc_engine_log.h
View file @
56fdf498
// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2015
,2017
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
...
...
@@ -19,23 +19,23 @@ namespace dhcp {
/// Defines the levels used to output debug messages from the @c AllocEngine.
/// @brief Traces normal operations
const
int
ALLOC_ENGINE_DBG_TRACE
=
DBGLVL_TRACE_BASIC
;
const
int
ALLOC_ENGINE_DBG_TRACE
=
isc
::
log
::
DBGLVL_TRACE_BASIC
;
/// @brief Records the results of various operations.
///
/// Messages logged at this level will typically contain summary of the
/// data retrieved.
const
int
ALLOC_ENGINE_DBG_RESULTS
=
DBGLVL_TRACE_BASIC_DATA
;
const
int
ALLOC_ENGINE_DBG_RESULTS
=
isc
::
log
::
DBGLVL_TRACE_BASIC_DATA
;
/// @brief Record detailed traces
///
/// Messages logged at this level will log detailed tracing information.
const
int
ALLOC_ENGINE_DBG_TRACE_DETAIL
=
DBGLVL_TRACE_DETAIL
;
const
int
ALLOC_ENGINE_DBG_TRACE_DETAIL
=
isc
::
log
::
DBGLVL_TRACE_DETAIL
;
/// @brief Records detailed results of various operations.
///
/// Messages logged at this level will contain detailed results.
const
int
ALLOC_ENGINE_DBG_TRACE_DETAIL_DATA
=
DBGLVL_TRACE_DETAIL_DATA
;
const
int
ALLOC_ENGINE_DBG_TRACE_DETAIL_DATA
=
isc
::
log
::
DBGLVL_TRACE_DETAIL_DATA
;
//@}
...
...
src/lib/dhcpsrv/dhcpsrv_log.h
View file @
56fdf498
// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2011-2015
,2017
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
...
...
@@ -23,27 +23,27 @@ namespace dhcp {
/// @brief Traces normal operations
///
/// E.g. sending a query to the database etc.
const
int
DHCPSRV_DBG_TRACE
=
DBGLVL_TRACE_BASIC
;
const
int
DHCPSRV_DBG_TRACE
=
isc
::
log
::
DBGLVL_TRACE_BASIC
;
/// @brief Records the results of the lookups
///
/// Using the example of tracing queries from the backend database, this will
/// just record the summary results.
const
int
DHCPSRV_DBG_RESULTS
=
DBGLVL_TRACE_BASIC_DATA
;
const
int
DHCPSRV_DBG_RESULTS
=
isc
::
log
::
DBGLVL_TRACE_BASIC_DATA
;
/// @brief Additional information
///
/// Record detailed tracing. This is generally reserved for tracing access to
/// the lease database.
const
int
DHCPSRV_DBG_TRACE_DETAIL
=
DBGLVL_TRACE_DETAIL
;
const
int
DHCPSRV_DBG_TRACE_DETAIL
=
isc
::
log
::
DBGLVL_TRACE_DETAIL
;
/// @brief Additional information
///
/// Record detailed (and verbose) data on the server.
const
int
DHCPSRV_DBG_TRACE_DETAIL_DATA
=
DBGLVL_TRACE_DETAIL_DATA
;
const
int
DHCPSRV_DBG_TRACE_DETAIL_DATA
=
isc
::
log
::
DBGLVL_TRACE_DETAIL_DATA
;
// Trace hook related operations
const
int
DHCPSRV_DBG_HOOKS
=
DBGLVL_TRACE_BASIC
;
const
int
DHCPSRV_DBG_HOOKS
=
isc
::
log
::
DBGLVL_TRACE_BASIC
;
///@}
...
...
src/lib/dhcpsrv/hosts_log.h
View file @
56fdf498
// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2015
,2017
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
...
...
@@ -24,23 +24,23 @@ namespace dhcp {
///
/// An example of the normal operation is the call to one of the functions
/// which retrieve the reservations or add new reservation.
const
int
HOSTS_DBG_TRACE
=
DBGLVL_TRACE_BASIC
;
const
int
HOSTS_DBG_TRACE
=
isc
::
log
::
DBGLVL_TRACE_BASIC
;
/// @brief Records the results of the lookups
///
/// Messages logged at this level will typically contain summary of the
/// data retrieved.
const
int
HOSTS_DBG_RESULTS
=
DBGLVL_TRACE_BASIC_DATA
;
const
int
HOSTS_DBG_RESULTS
=
isc
::
log
::
DBGLVL_TRACE_BASIC_DATA
;
/// @brief Record detailed traces
///
/// Messages logged at this level will log detailed tracing information.
const
int
HOSTS_DBG_TRACE_DETAIL
=
DBGLVL_TRACE_DETAIL
;
const
int
HOSTS_DBG_TRACE_DETAIL
=
isc
::
log
::
DBGLVL_TRACE_DETAIL
;
/// @brief Records detailed results of lookups.
///
/// Messages logged at this level will contain detailed results.
const
int
HOSTS_DBG_TRACE_DETAIL_DATA
=
DBGLVL_TRACE_DETAIL_DATA
;
const
int
HOSTS_DBG_TRACE_DETAIL_DATA
=
isc
::
log
::
DBGLVL_TRACE_DETAIL_DATA
;
///@}
...
...
src/lib/eval/eval_log.h
View file @
56fdf498
// Copyright (C) 2015-201
6
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2015-201
7
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
...
...
@@ -19,11 +19,11 @@ namespace dhcp {
/// Note that higher numbers equate to more verbose (and detailed) output.
// The first level traces normal operations,
const
int
EVAL_DBG_TRACE
=
DBGLVL_TRACE_BASIC
;
const
int
EVAL_DBG_TRACE
=
isc
::
log
::
DBGLVL_TRACE_BASIC
;
// Additional information on the calls. Report the values that were
// popped from or pushed to the value stack.
const
int
EVAL_DBG_STACK
=
DBGLVL_TRACE_DETAIL_DATA
;
const
int
EVAL_DBG_STACK
=
isc
::
log
::
DBGLVL_TRACE_DETAIL_DATA
;
/// @brief Eval Logger
///
...
...
src/lib/hooks/hooks_log.h
View file @
56fdf498
// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2013-2015
,2017
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
...
...
@@ -19,14 +19,14 @@ namespace hooks {
/// Note that higher numbers equate to more verbose (and detailed) output.
// The first level traces normal operations,
const
int
HOOKS_DBG_TRACE
=
DBGLVL_TRACE_BASIC
;
const
int
HOOKS_DBG_TRACE
=
isc
::
log
::
DBGLVL_TRACE_BASIC
;
// The next level traces each call to hook code.
const
int
HOOKS_DBG_CALLS
=
DBGLVL_TRACE_BASIC_DATA
;
const
int
HOOKS_DBG_CALLS
=
isc
::
log
::
DBGLVL_TRACE_BASIC_DATA
;
// Additional information on the calls. Report each call to a callout (even
// if there are multiple callouts on a hook) and each status return.
const
int
HOOKS_DBG_EXTENDED_CALLS
=
DBGLVL_TRACE_DETAIL_DATA
;
const
int
HOOKS_DBG_EXTENDED_CALLS
=
isc
::
log
::
DBGLVL_TRACE_DETAIL_DATA
;
/// @brief Hooks Logger
...
...
src/lib/http/connection.cc
View file @
56fdf498
...
...
@@ -60,7 +60,8 @@ HttpConnection::close() {
void
HttpConnection
::
stopThisConnection
()
{
try
{
LOG_DEBUG
(
http_logger
,
DBGLVL_TRACE_BASIC
,
HTTP_CONNECTION_STOP
)
LOG_DEBUG
(
http_logger
,
isc
::
log
::
DBGLVL_TRACE_BASIC
,
HTTP_CONNECTION_STOP
)
.
arg
(
getRemoteEndpointAddressAsText
());
connection_pool_
.
stop
(
shared_from_this
());
}
catch
(...)
{
...
...
@@ -128,7 +129,8 @@ HttpConnection::acceptorCallback(const boost::system::error_code& ec) {
acceptor_callback_
(
ec
);
if
(
!
ec
)
{
LOG_DEBUG
(
http_logger
,
DBGLVL_TRACE_DETAIL
,
HTTP_REQUEST_RECEIVE_START
)
LOG_DEBUG
(
http_logger
,
isc
::
log
::
DBGLVL_TRACE_DETAIL
,
HTTP_REQUEST_RECEIVE_START
)
.
arg
(
getRemoteEndpointAddressAsText
())
.
arg
(
static_cast
<
unsigned
>
(
request_timeout_
/
1000
));
request_timer_
.
setup
(
boost
::
bind
(
&
HttpConnection
::
requestTimeoutCallback
,
this
),
...
...
@@ -140,7 +142,8 @@ HttpConnection::acceptorCallback(const boost::system::error_code& ec) {
void
HttpConnection
::
socketReadCallback
(
boost
::
system
::
error_code
,
size_t
length
)
{
if
(
length
!=
0
)
{
LOG_DEBUG
(
http_logger
,
DBGLVL_TRACE_DETAIL_DATA
,
HTTP_DATA_RECEIVED
)
LOG_DEBUG
(
http_logger
,
isc
::
log
::
DBGLVL_TRACE_DETAIL_DATA
,
HTTP_DATA_RECEIVED
)
.
arg
(
length
)
.
arg
(
getRemoteEndpointAddressAsText
());
}
...
...
@@ -151,7 +154,8 @@ HttpConnection::socketReadCallback(boost::system::error_code, size_t length) {
doRead
();
}
else
{
LOG_DEBUG
(
http_logger
,
DBGLVL_TRACE_DETAIL
,
HTTP_REQUEST_RECEIVED
)
LOG_DEBUG
(
http_logger
,
isc
::
log
::
DBGLVL_TRACE_DETAIL
,
HTTP_REQUEST_RECEIVED
)
.
arg
(
getRemoteEndpointAddressAsText
());
try
{
request_
->
finalize
();
...
...
@@ -159,7 +163,8 @@ HttpConnection::socketReadCallback(boost::system::error_code, size_t length) {
}
HttpResponsePtr
response
=
response_creator_
->
createHttpResponse
(
request_
);
LOG_DEBUG
(
http_logger
,
DBGLVL_TRACE_DETAIL
,
HTTP_RESPONSE_SEND
)
LOG_DEBUG
(
http_logger
,
isc
::
log
::
DBGLVL_TRACE_DETAIL
,
HTTP_RESPONSE_SEND
)
.
arg
(
response
->
toBriefString
())
.
arg
(
getRemoteEndpointAddressAsText
());
asyncSendResponse
(
response
);
...
...
@@ -181,7 +186,8 @@ HttpConnection::socketWriteCallback(boost::system::error_code,
void
HttpConnection
::
requestTimeoutCallback
()
{
LOG_DEBUG
(
http_logger
,
DBGLVL_TRACE_DETAIL
,
HTTP_REQUEST_TIMEOUT_OCCURRED
)
LOG_DEBUG
(
http_logger
,
isc
::
log
::
DBGLVL_TRACE_DETAIL
,
HTTP_REQUEST_TIMEOUT_OCCURRED
)
.
arg
(
getRemoteEndpointAddressAsText
());
HttpResponsePtr
response
=
response_creator_
->
createStockHttpResponse
(
request_
,
...
...
src/lib/log/Makefile.am
View file @
56fdf498
...
...
@@ -9,7 +9,7 @@ CLEANFILES = *.gcno *.gcda
lib_LTLIBRARIES
=
libkea-log.la
libkea_log_la_SOURCES
=
libkea_log_la_SOURCES
+=
logimpl_messages.cc logimpl_messages.h
libkea_log_la_SOURCES
+=
log_dbglevels.h
libkea_log_la_SOURCES
+=
log_dbglevels.cc
log_dbglevels.h
libkea_log_la_SOURCES
+=
log_formatter.h log_formatter.cc
libkea_log_la_SOURCES
+=
logger.cc logger.h
libkea_log_la_SOURCES
+=
logger_impl.cc logger_impl.h
...
...
src/lib/log/log_dbglevels.h
View file @
56fdf498
// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2011-2015
,2017
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
...
...
@@ -38,7 +38,8 @@
/// enabling debugging. Symbols are prefixed DBGLVL so as not to clash with
/// DBG_ symbols in the various modules.
namespace
{
namespace
isc
{
namespace
log
{
/// Process startup/shutdown debug messages. Note that these are _debug_
/// messages, as other messages related to startup and shutdown may be output
...
...
@@ -46,35 +47,33 @@ namespace {
/// up, the "server started" message could be output at a severity of INFO.
/// "Server starting" and messages indicating the stages in startup should be
/// debug messages output at this severity.
///
/// This is given a value of 0 as that is the level selected if debugging is
/// enabled without giving a level.
const
int
DBGLVL_START_SHUT
=
0
;
extern
const
int
DBGLVL_START_SHUT
;
/// This debug level is reserved for logging the exchange of messages/commands
/// between processes, including configuration messages.
const
int
DBGLVL_COMMAND
=
10
;
extern
const
int
DBGLVL_COMMAND
;
/// If the commands have associated data, this level is when they are printed.
/// This includes configuration messages.
const
int
DBGLVL_COMMAND_DATA
=
20
;
extern
const
int
DBGLVL_COMMAND_DATA
;
// The following constants are suggested values for common operations.
// Depending on the exact nature of the code, modules may or may not use these
// levels.
/// Trace basic operations.
const
int
DBGLVL_TRACE_BASIC
=
40
;
extern
const
int
DBGLVL_TRACE_BASIC
;
/// Trace data associated with the basic operations.
const
int
DBGLVL_TRACE_BASIC_DATA
=
45
;
extern
const
int
DBGLVL_TRACE_BASIC_DATA
;
/// Trace detailed operations.
const
int
DBGLVL_TRACE_DETAIL
=
50
;
extern
const
int
DBGLVL_TRACE_DETAIL
;
/// Trace data associated with detailed operations.
const
int
DBGLVL_TRACE_DETAIL_DATA
=
55
;
extern
const
int
DBGLVL_TRACE_DETAIL_DATA
;
}
// Anonymous namespace
}
// log namespace
}
// isc namespace
#endif // LOG_DBGLVLS_H
src/lib/process/d_cfg_mgr.cc
View file @
56fdf498
...
...
@@ -124,7 +124,7 @@ DCfgMgrBase::setContext(DCfgContextBasePtr& context) {
isc
::
data
::
ConstElementPtr
DCfgMgrBase
::
parseConfig
(
isc
::
data
::
ConstElementPtr
config_set
,
bool
check_only
)
{
LOG_DEBUG
(
dctl_logger
,
DBGLVL_COMMAND
,
LOG_DEBUG
(
dctl_logger
,
isc
::
log
::
DBGLVL_COMMAND
,
DCTL_CONFIG_START
).
arg
(
config_set
->
str
());
if
(
!
config_set
)
{
...
...
@@ -280,7 +280,7 @@ DCfgMgrBase::simpleParseConfig(isc::data::ConstElementPtr config_set,
return
(
isc
::
config
::
createAnswer
(
1
,
std
::
string
(
"Can't parse NULL config"
)));
}
LOG_DEBUG
(
dctl_logger
,
DBGLVL_COMMAND
,