"loggers": [
{
"name": "kea-ctrl-agent",
- "output_options": [
+ "output-options": [
{
"output": "/var/log/kea-ctrl-agent.log",
// Several additional parameters are possible in addition
"name": "kea-dhcp-ddns",
// Configures how the log should be output.
- "output_options": [
+ "output-options": [
{
// Determines whether the log should be flushed to a file.
"flush": true,
"name": "kea-dhcp-ddns",
// Configures how the log should be output.
- "output_options": [
+ "output-options": [
{
// Determines whether the log should be flushed to a file.
"flush": true,
"loggers": [
{
"name": "kea-dhcp-ddns",
- "output_options": [
+ "output-options": [
{
"output": "stdout",
// Several additional parameters are possible in addition
"loggers": [
{
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "stdout",
// Several additional parameters are possible in addition
"name": "kea-dhcp4",
// Configures how the log should be output.
- "output_options": [
+ "output-options": [
{
// Determines whether the log should be flushed to a file.
"flush": true,
"name": "kea-dhcp4",
// Configures how the log should be output.
- "output_options": [
+ "output-options": [
{
// Determines whether the log should be flushed to a file.
"flush": true,
"loggers": [
{
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "/tmp/kea-dhcp4.log"
}
"loggers": [
{
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
// component. It tells DHCPv4 server to write all log messages (on
// severity INFO or more) to a file.
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
// This section specifies configuration of the HA hook library-specific
// logger.
"name": "kea-dhcp4.ha-hooks",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
// component. It tells DHCPv4 server to write all log messages (on
// severity INFO or more) to a file.
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
// This section specifies configuration of the HA hook library-specific
// logger.
"name": "kea-dhcp4.ha-hooks",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "stdout",
// Several additional parameters are possible in addition
"name": "kea-dhcp6",
// Configures how the log should be output.
- "output_options": [
+ "output-options": [
{
// Determines whether the log should be flushed to a file.
"flush": true,
"name": "kea-dhcp6",
// Configures how the log should be output.
- "output_options": [
+ "output-options": [
{
// Determines whether the log should be flushed to a file.
"flush": true,
"loggers": [
{
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "/tmp/kea-dhcp6.log"
}
"loggers": [
{
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
// component. It tells DHCPv6 server to write all log messages (on
// severity INFO or more) to a file.
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
// This section specifies configuration of the HA hook library-specific
// logger.
"name": "kea-dhcp6.ha-hooks",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
// component. It tells DHCPv6 server to write all log messages (on
// severity INFO or more) to a file.
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
// This section specifies configuration of the HA hook library-specific
// logger.
"name": "kea-dhcp6.ha-hooks",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "/var/log/kea-debug.log"
}
"loggers": [
{
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
"loggers": [
{
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
}
[
{
"name": "kea-netconf",
- "output_options":
+ "output-options":
[
{
"output": "stderr"
"loggers": [
{
"name": "kea-netconf",
- "output_options": [
+ "output-options": [
{
// "output": "/var/log/kea-netconf.log",
"output": "stdout",
"loggers": [
{
"name": "kea-netconf",
- "output_options": [
+ "output-options": [
{
// "output": "/var/log/kea-netconf.log",
"output": "stdout",
"loggers": [
{
"name": "kea-ctrl-agent",
- "output_options": [
+ "output-options": [
{
"output": "/var/log/kea-ctrl-agent.log",
"loggers": [
{
"name": "kea-ctrl-agent",
- "output_options": [
+ "output-options": [
{
"output": "/var/log/kea-ctrl-agent.log",
// will be rotated once it grows to 2MB and up to 4 files will be kept. The debuglevel
// (range 0 to 99) is used only when logging on DEBUG level.
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "/var/log/kea-dhcp4.log",
"maxsize": 2048000,
// will be rotated once it grows to 2MB and up to 4 files will be kept. The debuglevel
// (range 0 to 99) is used only when logging on DEBUG level.
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "/var/log/kea-dhcp4.log",
"maxsize": 2048000,
"loggers": [
{
"name": "kea-ctrl-agent",
- "output_options": [
+ "output-options": [
{
"output": "/var/log/kea-ctrl-agent.log",
"loggers": [
{
"name": "kea-ctrl-agent",
- "output_options": [
+ "output-options": [
{
"output": "/var/log/kea-ctrl-agent.log",
// will be rotated once it grows to 2MB and up to 4 files will be kept. The debuglevel
// (range 0 to 99) is used only when logging on DEBUG level.
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "/var/log/kea-dhcp4.log",
"maxsize": 2048000,
// will be rotated once it grows to 2MB and up to 4 files will be kept. The debuglevel
// (range 0 to 99) is used only when logging on DEBUG level.
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "/var/log/kea-dhcp4.log",
"maxsize": 2048000,
{
"debuglevel": 99,
"name": "kea-dhcpx",
- "output_options": [
+ "output-options": [
{
"output": "@abs_top_builddir@/src/bin/admin/tests/kea.log"
}
case 185: // $@39: %empty
#line 791 "agent_parser.yy"
{
- ctx.unique("output_options", ctx.loc2pos(yystack_[0].location));
+ ctx.unique("output-options", ctx.loc2pos(yystack_[0].location));
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
- ctx.stack_.back()->set("output_options", l);
+ ctx.stack_.back()->set("output-options", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.OUTPUT_OPTIONS);
}
#line 1707 "agent_parser.cc"
break;
- case 186: // output_options_list: "output_options" $@39 ":" "[" output_options_list_content "]"
+ case 186: // output_options_list: "output-options" $@39 ":" "[" output_options_list_content "]"
#line 797 "agent_parser.yy"
{
ctx.stack_.pop_back();
"\"key-file\"", "\"cert-required\"", "\"control-sockets\"", "\"dhcp4\"",
"\"dhcp6\"", "\"d2\"", "\"socket-name\"", "\"socket-type\"", "\"unix\"",
"\"hooks-libraries\"", "\"library\"", "\"parameters\"", "\"loggers\"",
- "\"name\"", "\"output_options\"", "\"output\"", "\"debuglevel\"",
+ "\"name\"", "\"output-options\"", "\"output\"", "\"debuglevel\"",
"\"severity\"", "\"flush\"", "\"maxsize\"", "\"maxver\"", "\"pattern\"",
"START_JSON", "START_AGENT", "START_SUB_AGENT", "\"constant string\"",
"\"integer\"", "\"floating point\"", "\"boolean\"", "$accept", "start",
TOKEN_PARAMETERS = 293, // "parameters"
TOKEN_LOGGERS = 294, // "loggers"
TOKEN_NAME = 295, // "name"
- TOKEN_OUTPUT_OPTIONS = 296, // "output_options"
+ TOKEN_OUTPUT_OPTIONS = 296, // "output-options"
TOKEN_OUTPUT = 297, // "output"
TOKEN_DEBUGLEVEL = 298, // "debuglevel"
TOKEN_SEVERITY = 299, // "severity"
S_PARAMETERS = 38, // "parameters"
S_LOGGERS = 39, // "loggers"
S_NAME = 40, // "name"
- S_OUTPUT_OPTIONS = 41, // "output_options"
+ S_OUTPUT_OPTIONS = 41, // "output-options"
S_OUTPUT = 42, // "output"
S_DEBUGLEVEL = 43, // "debuglevel"
S_SEVERITY = 44, // "severity"
LOGGERS "loggers"
NAME "name"
- OUTPUT_OPTIONS "output_options"
+ OUTPUT_OPTIONS "output-options"
OUTPUT "output"
DEBUGLEVEL "debuglevel"
SEVERITY "severity"
};
output_options_list: OUTPUT_OPTIONS {
- ctx.unique("output_options", ctx.loc2pos(@1));
+ ctx.unique("output-options", ctx.loc2pos(@1));
ElementPtr l(new ListElement(ctx.loc2pos(@1)));
- ctx.stack_.back()->set("output_options", l);
+ ctx.stack_.back()->set("output-options", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.OUTPUT_OPTIONS);
} COLON LSQUARE_BRACKET output_options_list_content RSQUARE_BRACKET {
///< Used while parsing Control-agent/loggers structures.
LOGGERS,
- ///< Used while parsing Control-agent/loggers/output_options structures.
+ ///< Used while parsing Control-agent/loggers/output-options structures.
OUTPUT_OPTIONS
} LexerContext;
\"loggers\": [
{
\"name\": \"kea-ctrl-agent\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
testParser(txt, ParserContext::PARSER_AGENT, false);
}
-// Test that output-options is an alias of output_options.
+// Test that output_options is an alias of output-options.
TEST(ParserTest, outputDashOptions) {
string txt = "{ \"Control-agent\": {"
" \"loggers\": [ { "
" \"name\": \"kea-ctrl-agent\","
- " \"output-options\": [ { \"output\": \"stdout\" } ],"
+ " \"output_options\": [ { \"output\": \"stdout\" } ],"
" \"severity\": \"INFO\" } ]"
"} }";
testParser(txt, ParserContext::PARSER_AGENT, false);
{
"debuglevel": 99,
"name": "kea-ctrl-agent",
- "output_options": [
+ "output-options": [
{
"output": "stdout",
},
-#line 1 "d2_lexer.cc"
+#line 2 "d2_lexer.cc"
-#line 3 "d2_lexer.cc"
+#line 4 "d2_lexer.cc"
#define YY_INT_ALIGNED short int
/* To avoid the call to exit... oops! */
#define YY_FATAL_ERROR(msg) isc::d2::D2ParserContext::fatal(msg)
-#line 1145 "d2_lexer.cc"
+#line 1146 "d2_lexer.cc"
/* noyywrap disables automatic rewinding for the next file to parse. Since we
always parse only a single string, there's no need to do any wraps. And
using yywrap requires linking with -lfl, which provides the default yywrap
by moving it ahead by yyleng bytes. yyleng specifies the length of the
currently matched token. */
#define YY_USER_ACTION driver.loc_.columns(yyleng);
-#line 1171 "d2_lexer.cc"
#line 1172 "d2_lexer.cc"
+#line 1173 "d2_lexer.cc"
#define INITIAL 0
#define COMMENT 1
}
-#line 1492 "d2_lexer.cc"
+#line 1493 "d2_lexer.cc"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
#line 826 "d2_lexer.ll"
ECHO;
YY_BREAK
-#line 2486 "d2_lexer.cc"
+#line 2487 "d2_lexer.cc"
case YY_END_OF_BUFFER:
{
case 235: // $@54: %empty
#line 915 "d2_parser.yy"
{
- ctx.unique("output_options", ctx.loc2pos(yystack_[0].location));
+ ctx.unique("output-options", ctx.loc2pos(yystack_[0].location));
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
- ctx.stack_.back()->set("output_options", l);
+ ctx.stack_.back()->set("output-options", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.OUTPUT_OPTIONS);
}
#line 1950 "d2_parser.cc"
break;
- case 236: // output_options_list: "output_options" $@54 ":" "[" output_options_list_content "]"
+ case 236: // output_options_list: "output-options" $@54 ":" "[" output_options_list_content "]"
#line 921 "d2_parser.yy"
{
ctx.stack_.pop_back();
"\"dns-servers\"", "\"hostname\"", "\"tsig-keys\"", "\"algorithm\"",
"\"digest-bits\"", "\"secret\"", "\"control-socket\"", "\"socket-type\"",
"\"socket-name\"", "\"hooks-libraries\"", "\"library\"",
- "\"parameters\"", "\"loggers\"", "\"name\"", "\"output_options\"",
+ "\"parameters\"", "\"loggers\"", "\"name\"", "\"output-options\"",
"\"output\"", "\"debuglevel\"", "\"severity\"", "\"flush\"",
"\"maxsize\"", "\"maxver\"", "\"pattern\"", "TOPLEVEL_JSON",
"TOPLEVEL_DHCPDDNS", "SUB_DHCPDDNS", "SUB_TSIG_KEY", "SUB_TSIG_KEYS",
TOKEN_PARAMETERS = 291, // "parameters"
TOKEN_LOGGERS = 292, // "loggers"
TOKEN_NAME = 293, // "name"
- TOKEN_OUTPUT_OPTIONS = 294, // "output_options"
+ TOKEN_OUTPUT_OPTIONS = 294, // "output-options"
TOKEN_OUTPUT = 295, // "output"
TOKEN_DEBUGLEVEL = 296, // "debuglevel"
TOKEN_SEVERITY = 297, // "severity"
S_PARAMETERS = 36, // "parameters"
S_LOGGERS = 37, // "loggers"
S_NAME = 38, // "name"
- S_OUTPUT_OPTIONS = 39, // "output_options"
+ S_OUTPUT_OPTIONS = 39, // "output-options"
S_OUTPUT = 40, // "output"
S_DEBUGLEVEL = 41, // "debuglevel"
S_SEVERITY = 42, // "severity"
LOGGERS "loggers"
NAME "name"
- OUTPUT_OPTIONS "output_options"
+ OUTPUT_OPTIONS "output-options"
OUTPUT "output"
DEBUGLEVEL "debuglevel"
SEVERITY "severity"
};
output_options_list: OUTPUT_OPTIONS {
- ctx.unique("output_options", ctx.loc2pos(@1));
+ ctx.unique("output-options", ctx.loc2pos(@1));
ElementPtr l(new ListElement(ctx.loc2pos(@1)));
- ctx.stack_.back()->set("output_options", l);
+ ctx.stack_.back()->set("output-options", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.OUTPUT_OPTIONS);
} COLON LSQUARE_BRACKET output_options_list_content RSQUARE_BRACKET {
/// Used while parsing DhcpDdns/loggers structures.
LOGGERS,
- /// Used while parsing DhcpDdns/loggers/output_options structures.
+ /// Used while parsing DhcpDdns/loggers/output-options structures.
OUTPUT_OPTIONS,
/// Used while parsing DhcpDdns/ncr-protocol
\"loggers\": [
{
\"name\": \"kea-dhcp-ddns\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
\"loggers\": [
{
\"name\": \"kea-dhcp-ddns\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
\"loggers\": [
{
\"name\": \"kea-dhcp-ddns\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
\"loggers\": [
{
\"name\": \"kea-dhcp-ddns\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
testParser(txt, D2ParserContext::PARSER_DHCPDDNS, false);
}
-// Test that output-options is an alias of output_options.
+// Test that output_options is an alias of output-options.
TEST(ParserTest, outputDashOptions) {
string txt =
"{ \"DhcpDdns\" : \n"
"{ \n"
" \"loggers\": [ {\n"
" \"name\": \"kea-dhcp-ddns\",\n"
- " \"output-options\": [ { \"output\": \"stdout\" } ],\n"
+ " \"output_options\": [ { \"output\": \"stdout\" } ],\n"
" \"severity\": \"INFO\" } ]\n"
" } \n"
"} \n";
"loggers": [
{
"name": "kea-dhcp-ddns",
- "output_options": [
+ "output-options": [
{
"output": "stdout"
},
{
"debuglevel": 0,
"name": "kea-dhcp-ddns",
- "output_options": [
+ "output-options": [
{
"flush": true,
"output": "stdout",
case 830: // $@132: %empty
#line 2908 "dhcp4_parser.yy"
{
- ctx.unique("output_options", ctx.loc2pos(yystack_[0].location));
+ ctx.unique("output-options", ctx.loc2pos(yystack_[0].location));
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
- ctx.stack_.back()->set("output_options", l);
+ ctx.stack_.back()->set("output-options", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.OUTPUT_OPTIONS);
}
#line 4607 "dhcp4_parser.cc"
break;
- case 831: // output_options_list: "output_options" $@132 ":" "[" output_options_list_content "]"
+ case 831: // output_options_list: "output-options" $@132 ":" "[" output_options_list_content "]"
#line 2914 "dhcp4_parser.yy"
{
ctx.stack_.pop_back();
"\"when-present\"", "\"never\"", "\"always\"", "\"when-not-present\"",
"\"hostname-char-set\"", "\"hostname-char-replacement\"",
"\"early-global-reservations-lookup\"", "\"ip-reservations-unique\"",
- "\"reservations-lookup-first\"", "\"loggers\"", "\"output_options\"",
+ "\"reservations-lookup-first\"", "\"loggers\"", "\"output-options\"",
"\"output\"", "\"debuglevel\"", "\"severity\"", "\"flush\"",
"\"maxsize\"", "\"maxver\"", "\"pattern\"", "\"compatibility\"",
"\"lenient-option-parsing\"", "\"ignore-dhcp-server-identifier\"",
TOKEN_IP_RESERVATIONS_UNIQUE = 446, // "ip-reservations-unique"
TOKEN_RESERVATIONS_LOOKUP_FIRST = 447, // "reservations-lookup-first"
TOKEN_LOGGERS = 448, // "loggers"
- TOKEN_OUTPUT_OPTIONS = 449, // "output_options"
+ TOKEN_OUTPUT_OPTIONS = 449, // "output-options"
TOKEN_OUTPUT = 450, // "output"
TOKEN_DEBUGLEVEL = 451, // "debuglevel"
TOKEN_SEVERITY = 452, // "severity"
S_IP_RESERVATIONS_UNIQUE = 191, // "ip-reservations-unique"
S_RESERVATIONS_LOOKUP_FIRST = 192, // "reservations-lookup-first"
S_LOGGERS = 193, // "loggers"
- S_OUTPUT_OPTIONS = 194, // "output_options"
+ S_OUTPUT_OPTIONS = 194, // "output-options"
S_OUTPUT = 195, // "output"
S_DEBUGLEVEL = 196, // "debuglevel"
S_SEVERITY = 197, // "severity"
RESERVATIONS_LOOKUP_FIRST "reservations-lookup-first"
LOGGERS "loggers"
- OUTPUT_OPTIONS "output_options"
+ OUTPUT_OPTIONS "output-options"
OUTPUT "output"
DEBUGLEVEL "debuglevel"
SEVERITY "severity"
};
output_options_list: OUTPUT_OPTIONS {
- ctx.unique("output_options", ctx.loc2pos(@1));
+ ctx.unique("output-options", ctx.loc2pos(@1));
ElementPtr l(new ListElement(ctx.loc2pos(@1)));
- ctx.stack_.back()->set("output_options", l);
+ ctx.stack_.back()->set("output-options", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.OUTPUT_OPTIONS);
} COLON LSQUARE_BRACKET output_options_list_content RSQUARE_BRACKET {
/// Used while parsing Dhcp4/loggers structures.
LOGGERS,
- /// Used while parsing Dhcp4/loggers/output_options structures.
+ /// Used while parsing Dhcp4/loggers/output-options structures.
OUTPUT_OPTIONS,
/// Used while parsing Dhcp4/dhcp-ddns.
" ,\"loggers\": [ { \n"
" \"name\": \"kea\", \n"
" \"severity\": \"FATAL\", \n"
- " \"output_options\": [{ \n"
+ " \"output-options\": [{ \n"
" \"output\": \"/dev/null\" \n"
" }] \n"
" }] \n";
" ,\"loggers\": [ { \n"
" \"name\": \"kea\", \n"
" \"severity\": \"FATAL\", \n"
- " \"output_options\": [{ \n"
+ " \"output-options\": [{ \n"
" \"output\": \"/dev/null\" \n"
" }] \n"
" }] \n";
\"loggers\": [
{
\"name\": \"kea-dhcp4\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
\"loggers\": [
{
\"name\": \"kea-dhcp4\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
\"loggers\": [
{
\"name\": \"kea-dhcp4\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
\"loggers\": [
{
\"name\": \"kea-dhcp4\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
\"loggers\": [
{
\"name\": \"kea-dhcp4\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
\"loggers\": [
{
\"name\": \"kea-dhcp4\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
testParser(txt, Parser4Context::PARSER_DHCP4, false);
}
-// Test that output-options is an alias of output_options.
+// Test that output_options is an alias of output-options.
TEST(ParserTest, outputDashOptions) {
string txt = "{ \"Dhcp4\": { \"interfaces-config\": {"
" \"interfaces\": [ \"*\" ]"
"\"valid-lifetime\": 4000,\n"
"\"loggers\": [ { "
" \"name\": \"kea-dhcp4\","
- " \"output-options\": [ { \"output\": \"stdout\" } ],"
+ " \"output_options\": [ { \"output\": \"stdout\" } ],"
" \"severity\": \"INFO\" } ]\n"
"} }";
testParser(txt, Parser4Context::PARSER_DHCP4, false);
{
"debuglevel": 99,
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
"output": "stdout",
},
case 869: // $@137: %empty
#line 3054 "dhcp6_parser.yy"
{
- ctx.unique("output_options", ctx.loc2pos(yystack_[0].location));
+ ctx.unique("output-options", ctx.loc2pos(yystack_[0].location));
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
- ctx.stack_.back()->set("output_options", l);
+ ctx.stack_.back()->set("output-options", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.OUTPUT_OPTIONS);
}
#line 4770 "dhcp6_parser.cc"
break;
- case 870: // output_options_list: "output_options" $@137 ":" "[" output_options_list_content "]"
+ case 870: // output_options_list: "output-options" $@137 ":" "[" output_options_list_content "]"
#line 3060 "dhcp6_parser.yy"
{
ctx.stack_.pop_back();
"\"when-not-present\"", "\"hostname-char-set\"",
"\"hostname-char-replacement\"", "\"early-global-reservations-lookup\"",
"\"ip-reservations-unique\"", "\"reservations-lookup-first\"",
- "\"loggers\"", "\"output_options\"", "\"output\"", "\"debuglevel\"",
+ "\"loggers\"", "\"output-options\"", "\"output\"", "\"debuglevel\"",
"\"severity\"", "\"flush\"", "\"maxsize\"", "\"maxver\"", "\"pattern\"",
"\"compatibility\"", "\"lenient-option-parsing\"", "TOPLEVEL_JSON",
"TOPLEVEL_DHCP6", "SUB_DHCP6", "SUB_INTERFACES6", "SUB_SUBNET6",
TOKEN_IP_RESERVATIONS_UNIQUE = 453, // "ip-reservations-unique"
TOKEN_RESERVATIONS_LOOKUP_FIRST = 454, // "reservations-lookup-first"
TOKEN_LOGGERS = 455, // "loggers"
- TOKEN_OUTPUT_OPTIONS = 456, // "output_options"
+ TOKEN_OUTPUT_OPTIONS = 456, // "output-options"
TOKEN_OUTPUT = 457, // "output"
TOKEN_DEBUGLEVEL = 458, // "debuglevel"
TOKEN_SEVERITY = 459, // "severity"
S_IP_RESERVATIONS_UNIQUE = 198, // "ip-reservations-unique"
S_RESERVATIONS_LOOKUP_FIRST = 199, // "reservations-lookup-first"
S_LOGGERS = 200, // "loggers"
- S_OUTPUT_OPTIONS = 201, // "output_options"
+ S_OUTPUT_OPTIONS = 201, // "output-options"
S_OUTPUT = 202, // "output"
S_DEBUGLEVEL = 203, // "debuglevel"
S_SEVERITY = 204, // "severity"
RESERVATIONS_LOOKUP_FIRST "reservations-lookup-first"
LOGGERS "loggers"
- OUTPUT_OPTIONS "output_options"
+ OUTPUT_OPTIONS "output-options"
OUTPUT "output"
DEBUGLEVEL "debuglevel"
SEVERITY "severity"
};
output_options_list: OUTPUT_OPTIONS {
- ctx.unique("output_options", ctx.loc2pos(@1));
+ ctx.unique("output-options", ctx.loc2pos(@1));
ElementPtr l(new ListElement(ctx.loc2pos(@1)));
- ctx.stack_.back()->set("output_options", l);
+ ctx.stack_.back()->set("output-options", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.OUTPUT_OPTIONS);
} COLON LSQUARE_BRACKET output_options_list_content RSQUARE_BRACKET {
/// Used while parsing Dhcp6/loggers structures.
LOGGERS,
- /// Used while parsing Dhcp6/loggers/output_options structures.
+ /// Used while parsing Dhcp6/loggers/output-options structures.
OUTPUT_OPTIONS,
/// Used while parsing Dhcp6/dhcp-ddns.
" ,\"loggers\": [ { \n"
" \"name\": \"kea\", \n"
" \"severity\": \"FATAL\", \n"
- " \"output_options\": [{ \n"
+ " \"output-options\": [{ \n"
" \"output\": \"/dev/null\" \n"
" }] \n"
" }] \n";
" ,\"loggers\": [ { \n"
" \"name\": \"kea\", \n"
" \"severity\": \"FATAL\", \n"
- " \"output_options\": [{ \n"
+ " \"output-options\": [{ \n"
" \"output\": \"/dev/null\" \n"
" }] \n"
" }] \n";
\"loggers\": [
{
\"name\": \"kea-dhcp6\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
\"loggers\": [
{
\"name\": \"kea-dhcp6\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
\"loggers\": [
{
\"name\": \"kea-dhcp6\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
\"loggers\": [
{
\"name\": \"kea-dhcp6\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
\"loggers\": [
{
\"name\": \"kea-dhcp6\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
testParser(txt, Parser6Context::PARSER_DHCP6, false);
}
-// Test that output-options is an alias of output_options.
+// Test that output_options is an alias of output-options.
TEST(ParserTest, outputDashOptions) {
string txt = "{ \"Dhcp6\": { \"interfaces-config\": {"
" \"interfaces\": [ \"*\" ]"
"\"valid-lifetime\": 4000,\n"
"\"loggers\": [ { "
" \"name\": \"kea-dhcp6\","
- " \"output-options\": [ { \"output\": \"stdout\" } ],"
+ " \"output_options\": [ { \"output\": \"stdout\" } ],"
" \"severity\": \"INFO\" } ]\n"
"} }";
testParser(txt, Parser6Context::PARSER_DHCP6, false);
{
"debuglevel": 99,
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
"output": "stdout",
},
{
// This specifies the logging for Control Agent daemon.
"name": "kea-ctrl-agent",
- "output_options": [
+ "output-options": [
{
// Specifies the output file. There are several special values
// supported:
{
// This specifies the logging for D2 (DHCP-DDNS) daemon.
"name": "kea-dhcp-ddns",
- "output_options": [
+ "output-options": [
{
// Specifies the output file. There are several special values
// supported:
// component. It tells DHCPv4 server to write all log messages (on
// severity INFO or more) to a file.
"name": "kea-dhcp4",
- "output_options": [
+ "output-options": [
{
// Specifies the output file. There are several special values
// supported:
// This specifies the logging for kea-dhcp6 logger, i.e. all logs
// generated by Kea DHCPv6 server.
"name": "kea-dhcp6",
- "output_options": [
+ "output-options": [
{
// Specifies the output file. There are several special values
// supported:
{
// This specifies the logging for Netconf daemon.
"name": "kea-netconf",
- "output_options": [
+ "output-options": [
{
// Specifies the output file. There are several special values
// supported:
\"loggers\": [
{
\"name\": \"kea-dhcp4\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
\"loggers\": [
{
\"name\": \"kea-dhcp6\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
\"loggers\": [
{
\"name\": \"kea-dhcp-ddns\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
\"loggers\": [
{
\"name\": \"kea-ctrl-agent\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
\"loggers\": [
{
\"name\": \"kea-netconf\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
case 155: // $@29: %empty
#line 680 "netconf_parser.yy"
{
- ctx.unique("output_options", ctx.loc2pos(yystack_[0].location));
+ ctx.unique("output-options", ctx.loc2pos(yystack_[0].location));
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
- ctx.stack_.back()->set("output_options", l);
+ ctx.stack_.back()->set("output-options", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.OUTPUT_OPTIONS);
}
#line 1508 "netconf_parser.cc"
break;
- case 156: // output_options_list: "output_options" $@29 ":" "[" output_options_list_content "]"
+ case 156: // output_options_list: "output-options" $@29 ":" "[" output_options_list_content "]"
#line 686 "netconf_parser.yy"
{
ctx.stack_.pop_back();
"\"control-socket\"", "\"socket-type\"", "\"unix\"", "\"http\"",
"\"stdout\"", "\"socket-name\"", "\"socket-url\"", "\"hooks-libraries\"",
"\"library\"", "\"parameters\"", "\"loggers\"", "\"name\"",
- "\"output_options\"", "\"output\"", "\"debuglevel\"", "\"severity\"",
+ "\"output-options\"", "\"output\"", "\"debuglevel\"", "\"severity\"",
"\"flush\"", "\"maxsize\"", "\"maxver\"", "\"pattern\"", "START_JSON",
"START_NETCONF", "START_SUB_NETCONF", "\"constant string\"",
"\"integer\"", "\"floating point\"", "\"boolean\"", "$accept", "start",
TOKEN_PARAMETERS = 286, // "parameters"
TOKEN_LOGGERS = 287, // "loggers"
TOKEN_NAME = 288, // "name"
- TOKEN_OUTPUT_OPTIONS = 289, // "output_options"
+ TOKEN_OUTPUT_OPTIONS = 289, // "output-options"
TOKEN_OUTPUT = 290, // "output"
TOKEN_DEBUGLEVEL = 291, // "debuglevel"
TOKEN_SEVERITY = 292, // "severity"
S_PARAMETERS = 31, // "parameters"
S_LOGGERS = 32, // "loggers"
S_NAME = 33, // "name"
- S_OUTPUT_OPTIONS = 34, // "output_options"
+ S_OUTPUT_OPTIONS = 34, // "output-options"
S_OUTPUT = 35, // "output"
S_DEBUGLEVEL = 36, // "debuglevel"
S_SEVERITY = 37, // "severity"
LOGGERS "loggers"
NAME "name"
- OUTPUT_OPTIONS "output_options"
+ OUTPUT_OPTIONS "output-options"
OUTPUT "output"
DEBUGLEVEL "debuglevel"
SEVERITY "severity"
};
output_options_list: OUTPUT_OPTIONS {
- ctx.unique("output_options", ctx.loc2pos(@1));
+ ctx.unique("output-options", ctx.loc2pos(@1));
ElementPtr l(new ListElement(ctx.loc2pos(@1)));
- ctx.stack_.back()->set("output_options", l);
+ ctx.stack_.back()->set("output-options", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.OUTPUT_OPTIONS);
} COLON LSQUARE_BRACKET output_options_list_content RSQUARE_BRACKET {
///< Used while parsing Netconf/loggers structures.
LOGGERS,
- ///< Used while parsing Netconf/loggers/output_options structures.
+ ///< Used while parsing Netconf/loggers/output-options structures.
OUTPUT_OPTIONS
} LexerContext;
testParser(txt, ParserContext::PARSER_NETCONF, false);
}
-// Test that output-options is an alias of output_options.
+// Test that output_options is an alias of output-options.
TEST(ParserTest, outputDashOptions) {
string txt= "{ \"Netconf\": {"
" \"loggers\": [ { "
" \"name\": \"kea-netconf\","
- " \"output-options\": [ { \"output\": \"stdout\" } ],"
+ " \"output_options\": [ { \"output\": \"stdout\" } ],"
" \"severity\": \"INFO\" } ]"
"} }";
testParser(txt, ParserContext::PARSER_NETCONF, false);
\"loggers\": [
{
\"name\": \"kea-netconf\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
\"loggers\": [
{
\"name\": \"kea-ctrl-agent\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
\"loggers\": [
{
\"name\": \"kea-ctrl-agent\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"$LOG_FILE\"
}
\"loggers\": [
{
\"name\": \"kea-ctrl-agent\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"${LOG_FILE}\"
}
\"loggers\": [
{
\"name\": \"kea-ctrl-agent\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"${LOG_FILE}\"
}
\"loggers\": [
{
\"name\": \"kea-ctrl-agent\",
- \"output_options\": [
+ \"output-options\": [
{
\"output\": \"${LOG_FILE}\"
}
info.debuglevel_ = 99;
}
- isc::data::ConstElementPtr output_options = entry->get("output_options");
+ isc::data::ConstElementPtr output_options = entry->get("output-options");
if (output_options) {
parseOutputOptions(info.destinations_, output_options);
void LogConfigParser::parseOutputOptions(std::vector<LoggingDestination>& destination,
isc::data::ConstElementPtr output_options) {
if (!output_options) {
- isc_throw(BadValue, "Missing 'output_options' structure in 'loggers'");
+ isc_throw(BadValue, "Missing 'output-options' structure in 'loggers'");
}
BOOST_FOREACH(ConstElementPtr output_option, output_options->listValue()) {
isc::data::ConstElementPtr output = output_option->get("output");
if (!output) {
- isc_throw(BadValue, "output_options entry does not have a mandatory 'output' "
+ isc_throw(BadValue, "output-options entry does not have a mandatory 'output' "
"element (" << output_option->getPosition() << ")");
}
dest.output_ = output->stringValue();
/// The data structures converted to JSON format have the following syntax:
/// {
/// "name": "kea",
-/// "output_options": [
+/// "output-options": [
/// {
/// "output": "/home/thomson/kea-inst/kea-warn.log",
/// "maxver": 8,
/// @brief parses one structure in Server/loggers.
void parseConfigEntry(isc::data::ConstElementPtr entry);
- /// @brief Parses output_options structure
+ /// @brief Parses output-options structure
///
/// @ref @c LogConfigParser for an example in JSON format.
///
contextToElement(result);
// Set name
result->set("name", Element::create(name_));
- // Set output_options if not empty
+ // Set output-options if not empty
if (!destinations_.empty()) {
ElementPtr options = Element::createList();
for (auto const& dest : destinations_) {
options->add(dest.toElement());
}
- result->set("output_options", options);
+ result->set("output-options", options);
}
// Set severity
std::string severity;
/// The structure in JSON form has the following syntax:
/// {
/// "name": "*",
-/// "output_options": [
+/// "output-options": [
/// {
/// "output": "/path/to/the/logfile.log",
/// "maxver": 8,
"{ \"loggers\": ["
" {"
" \"name\": \"kea\","
- " \"output_options\": ["
+ " \"output-options\": ["
" {"
" \"output\": \"stdout\""
" }"
"{ \"loggers\": ["
" {"
" \"name\": \"kea\","
- " \"output_options\": ["
+ " \"output-options\": ["
" {"
" \"output\": \"stdout\","
" \"flush\": true"
"{ \"loggers\": ["
" {"
" \"name\": \"kea\","
- " \"output_options\": ["
+ " \"output-options\": ["
" {"
" \"output\": \"stdout\","
" \"flush\": true"
"{ \"loggers\": ["
" {"
" \"name\": \"kea\","
- " \"output_options\": ["
+ " \"output-options\": ["
" {"
" \"output\": \"logfile.txt\""
" }"
"{ \"loggers\": ["
" {"
" \"name\": \"kea\","
- " \"output_options\": ["
+ " \"output-options\": ["
" {"
" \"output\": \"logfile.txt\","
" \"flush\": true"
" },"
" {"
" \"name\": \"wombat\","
- " \"output_options\": ["
+ " \"output-options\": ["
" {"
" \"output\": \"logfile2.txt\","
" \"flush\": false"
"{ \"loggers\": ["
" {"
" \"name\": \"kea\","
- " \"output_options\": ["
+ " \"output-options\": ["
" {"
" \"output\": \"logfile.txt\""
" },"
"{ \"loggers\": ["
" {"
" \"name\": \"kea\","
- " \"output_options\": ["
+ " \"output-options\": ["
" {"
" \"output\": \""
<< TEST_LOG_NAME << "\"," <<
"{ \"loggers\": ["
" {"
" \"name\": \"kea\","
- " \"output_options\": ["
+ " \"output-options\": ["
" {"
" \"output\": \"stdout\","
" \"pattern\": \"mylog %m\\n\""
"{ \"loggers\": ["
" {"
" \"name\": \"kea\","
- " \"output_options\": ["
+ " \"output-options\": ["
" {"
" \"output\": \"stdout\","
" \"pattern\": \"\""
"debuglevel": 99,
"name": "kea",
- "output_options": [
+ "output-options": [
{
"output": "kea.test.log",
"flush": true,
std::string header = "{\n";
std::string begin =
"\"name\": \"kea\",\n"
- "\"output_options\": [ {\n"
+ "\"output-options\": [ {\n"
" \"output\": \"stdout\", \"flush\": true, \"pattern\": \"\" } ],\n"
"\"severity\": \"";
std::string dbglvl = "\",\n\"debuglevel\": ";
ASSERT_TRUE(severity);
ASSERT_EQ(Element::string, severity->getType());
EXPECT_EQ("WARN", severity->stringValue());
- ConstElementPtr options = logger->get("output_options");
+ ConstElementPtr options = logger->get("output-options");
ASSERT_TRUE(options);
ASSERT_EQ(1, options->size());
ConstElementPtr option = options->get(0);
ElementPtr logger = Element::createMap();
logger->set("name", Element::create("foo"));
logger->set("severity", Element::create("WARN"));
- logger->set("output_options", options);
+ logger->set("output-options", options);
ElementPtr loggers = Element::createList();
loggers->add(logger);
ASSERT_NO_THROW_LOG(translator_->setLoggers(xpath, loggers));
ASSERT_TRUE(severity);
ASSERT_EQ(Element::string, severity->getType());
EXPECT_EQ("WARN", severity->stringValue());
- ConstElementPtr got_os = logger->get("output_options");
+ ConstElementPtr got_os = logger->get("output-options");
ASSERT_TRUE(got_os);
ASSERT_EQ(1, got_os->size());
ConstElementPtr got_o = got_os->get(0);
ConstElementPtr options = getOutputOptions(data_node);
if (options) {
- result->set("output_options", options);
+ result->set("output-options", options);
}
return (result->empty() ? ElementPtr() : result);
checkAndSetLeaf(elem, xpath, "severity", LeafBaseType::Enum);
checkAndSetUserContext(elem, xpath);
- ConstElementPtr options = elem->get("output_options");
+ ConstElementPtr options = elem->get("output-options");
if (options && !options->empty()) {
setOutputOptions(xpath, options);
}
/// @code
/// {
/// "name": <name>,
-/// "output_options": [ <output options> ],
+/// "output-options": [ <output options> ],
/// "severity": <severity>,
/// "debuglevel": <debug level>,
/// "user-context": { <json map> },
/// {
/// "name": "foo",
/// "severity": "WARN",
-/// "output_options":
+/// "output-options":
/// [
/// {
/// "output": "/bar",