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
a1b5da4d
Commit
a1b5da4d
authored
Apr 26, 2017
by
Tomek Mrugalski
🛰
Browse files
[5253] Logging information is now written in config-write.
parent
2038bae5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/process/d_controller.cc
View file @
a1b5da4d
...
...
@@ -449,7 +449,28 @@ DControllerBase::configWriteHandler(const std::string&,
// Ok, it's time to write the file.
size_t
size
=
0
;
ConstElementPtr
cfg
=
process_
->
getCfgMgr
()
->
getContext
()
->
toElement
();
ElementPtr
cfg
=
process_
->
getCfgMgr
()
->
getContext
()
->
toElement
();
// Logging storage is messed up in CA. During its configuration (see
// DControllerBase::configFromFile() it calls Daemon::configureLogger()
// that stores the logging info in isc::dhcp::CfgMgr::getStagingCfg().
// This is later moved to getCurrentCfg() when the configuration is
// commited. All control-agent specific configuration is stored in
// a structure accessible by process_->getCfgMgr()->getContext(). Note
// logging information is not stored there.
//
// As a result, we need to extract the CA configuration from one
// place and logging from another.
ConstElementPtr
loginfo
=
isc
::
dhcp
::
CfgMgr
::
instance
().
getCurrentCfg
()
->
toElement
();
if
(
loginfo
)
{
// If there was a config stored in dhcp::CfgMgr, try to get Logging info from it.
loginfo
=
loginfo
->
get
(
"Logging"
);
}
if
(
loginfo
)
{
// If there is some logging information, add it to our config.
cfg
->
set
(
"Logging"
,
loginfo
);
}
try
{
size
=
writeConfigFile
(
filename
,
cfg
);
}
catch
(
const
isc
::
Exception
&
ex
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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