"Logging": {
"loggers": [
{
- "name": "kea",
+ "name": "kea-dhcp4",
"output_options": [
{
"output": "/var/log/kea-debug.log"
"Logging": {
"loggers": [
{
- "name": "kea",
+ "name": "kea-dhcp4",
"output_options": [
{
"output": "stdout"
"Logging": {
"loggers": [
{
- "name": "kea",
+ "name": "kea-dhcp6",
"output_options": [
{
"output": "stdout"
"Logging": {
"loggers": [
{
- "name": "kea",
+ "name": "kea-dhcp6",
"output_options": [
{
"output": "/var/log/kea-debug.log"
<para>
One final note about the naming. When specifying the
- module name within a logger, use the name of the module
- as specified in JSON configuration, e.g.
- <quote>Dhcp4</quote> for the Dhcp4 module,
- <quote>Dhcp6</quote> for the Dhcp6 module, etc. When
+ module name within a logger, use the name of the binary file,
+ e.g. <quote>kea-dhcp4</quote> for the DHCPv4 module,
+ <quote>kea-dhcp6</quote> for the DHCPv6 module, etc. When
the message is logged, the message will include the name
of the logger generating the message, but with the module
name replaced by the name of the process implementing
the module (so for example, a message generated by the
- <quote>Dhcp4</quote> logger will appear in the output
+ <quote>DHCPv4</quote> logger will appear in the output
with a logger name of <quote>kea-dhcp4</quote>).
</para>
</para>
<itemizedlist>
<listitem>
- <simpara>kea.dhcp4</simpara>
+ <simpara>kea-dhcp4.dhcp4</simpara>
</listitem>
<listitem>
- <simpara>kea.dhcp6</simpara>
+ <simpara>kea-dhcp6.dhcp6</simpara>
</listitem>
<listitem>
<simpara>kea-dhcp-ddns.dhcpddns</simpara>
</listitem>
<listitem>
- <simpara>kea.dhcpsrv</simpara>
+ <simpara>kea-dhcp4.dhcpsrv</simpara>
+ </listitem>
+ <listitem>
+ <simpara>kea-dhcp6.dhcpsrv</simpara>
</listitem>
</itemizedlist>
+ <para>Additional loggers may be defined in the future.</para>
</section>
<section>
"Logging": {
"loggers": [
{
- "name": "kea",
+ "name": "kea-dhcp4",
"output_options": [
{
"output": "stdout"
"Logging": {
"loggers": [
{
- "name": "kea",
+ "name": "kea-dhcp6",
"output_options": [
{
"output": "/var/log/kea-debug.log",
/// This is a logger initialization for JSON file backend.
/// For now, it's just setting log messages to be printed on stdout.
/// @todo: Implement this properly (see #3427)
-void Daemon::loggerInit(const char*, bool verbose) {
+void Daemon::loggerInit(const char* logger_name, bool verbose) {
setenv("B10_LOCKFILE_DIR_FROM_BUILD", "/tmp", 1);
- setenv("B10_LOGGER_ROOT", "kea", 0);
+ setenv("B10_LOGGER_ROOT", logger_name, 0);
setenv("B10_LOGGER_SEVERITY", (verbose ? "DEBUG":"INFO"), 0);
setenv("B10_LOGGER_DBGLEVEL", "99", 0);
setenv("B10_LOGGER_DESTINATION", "stdout", 0);
const char* const DHCP4_NAME = "kea-dhcp4";
-const char* const DHCP4_LOGGER_NAME = "kea";
+const char* const DHCP4_LOGGER_NAME = "kea-dhcp4";
void
usage() {
try {
// Initialize logging. If verbose, we'll use maximum verbosity.
- // If standalone is enabled, do not buffer initial log messages
Daemon::loggerInit(DHCP4_LOGGER_NAME, verbose_mode);
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_START, DHCP4_START_INFO)
.arg(getpid()).arg(port_number).arg(verbose_mode ? "yes" : "no");
// Initialize the server.
server.init(config_file);
} catch (const std::exception& ex) {
- LOG_ERROR(dhcp4_logger, DHCP4_INIT_FAIL).arg(ex.what());
- // We should not continue if were told to configure (either read
- // config file or establish Bundy control session).
-
- isc::log::LoggerManager log_manager;
- log_manager.process();
+ try {
+ // Let's log out what went wrong.
+ isc::log::LoggerManager log_manager;
+ log_manager.process();
+ LOG_ERROR(dhcp4_logger, DHCP4_INIT_FAIL).arg(ex.what());
+ } catch (...) {
+ // The exeption thrown during the initialization could originate
+ // from logger subsystem. Therefore LOG_ERROR() may fail as well.
+ cerr << "Failed to initialize server: " << ex.what() << endl;
+ }
- cerr << "Failed to initialize server: " << ex.what() << endl;
return (EXIT_FAILURE);
}
{
\"loggers\": [
{
- \"name\": \"kea\",
+ \"name\": \"kea-dhcp4\",
\"output_options\": [
{
\"output\": \"$LOG_FILE\"
{
\"loggers\": [
{
- \"name\": \"kea\",
+ \"name\": \"kea-dhcp4\",
\"output_options\": [
{
\"output\": \"$LOG_FILE\"
/// This is a logger initialization for JSON file backend.
/// For now, it's just setting log messages to be printed on stdout.
/// @todo: Implement this properly (see #3427)
-void Daemon::loggerInit(const char*, bool verbose) {
+void Daemon::loggerInit(const char* logger_name, bool verbose) {
setenv("B10_LOCKFILE_DIR_FROM_BUILD", "/tmp", 1);
- setenv("B10_LOGGER_ROOT", "kea", 0);
+ setenv("B10_LOGGER_ROOT", logger_name, 0);
setenv("B10_LOGGER_SEVERITY", (verbose ? "DEBUG":"INFO"), 0);
setenv("B10_LOGGER_DBGLEVEL", "99", 0);
setenv("B10_LOGGER_DESTINATION", "stdout", 0);
namespace {
const char* const DHCP6_NAME = "kea-dhcp6";
-const char* const DHCP6_LOGGER_NAME = "kea";
+const char* const DHCP6_LOGGER_NAME = "kea-dhcp6";
void
usage() {
server.init(config_file);
} catch (const std::exception& ex) {
- LOG_ERROR(dhcp6_logger, DHCP6_INIT_FAIL).arg(ex.what());
- // We should not continue if were told to configure (either read
- // config file or establish BIND10 control session).
- isc::log::LoggerManager log_manager;
- log_manager.process();
+ try {
+ // Let's log out what went wrong.
+ isc::log::LoggerManager log_manager;
+ log_manager.process();
+ LOG_ERROR(dhcp6_logger, DHCP6_INIT_FAIL).arg(ex.what());
+ } catch (...) {
+ // The exeption thrown during the initialization could originate
+ // from logger subsystem. Therefore LOG_ERROR() may fail as well.
+ cerr << "Failed to initialize server: " << ex.what() << endl;
+ }
- cerr << "Failed to initialize server: " << ex.what() << endl;
return (EXIT_FAILURE);
}
{
\"loggers\": [
{
- \"name\": \"kea\",
+ \"name\": \"kea-dhcp6\",
\"output_options\": [
{
\"output\": \"$LOG_FILE\"
{
\"loggers\": [
{
- \"name\": \"kea\",
+ \"name\": \"kea-dhcp6\",
\"output_options\": [
{
\"output\": \"$LOG_FILE\"
\"tsig_keys\": [],
\"forward_ddns\" : {},
\"reverse_ddns\" : {}
+ },
+
+ \"Logging\":
+ {
+ \"loggers\": [
+ {
+ \"name\": \"*\",
+ \"output_options\": [
+ {
+ \"output\": \"$LOG_FILE\"
+ }
+ ],
+ \"severity\": \"INFO\"
+ }
+ ]
}
}"