summaryrefslogtreecommitdiffstats
path: root/src/lib/process/log_parser.cc
diff options
context:
space:
mode:
authorThomas Markwalder <tmark@isc.org>2019-08-05 16:25:15 +0200
committerTomek Mrugalski <tomasz@isc.org>2019-08-14 10:57:56 +0200
commit784d55996c2fc7dab410e298a4782d98ff98e597 (patch)
treecf1b5d30a8c410061d68c622fbd9be811aae0a58 /src/lib/process/log_parser.cc
parent[#150,!473] ChangeLog updated (diff)
downloadkea-784d55996c2fc7dab410e298a4782d98ff98e597.tar.xz
kea-784d55996c2fc7dab410e298a4782d98ff98e597.zip
[#665,!460] Initial implementation, kea-dhcp4 only
Added an optional "pattern" parameter to logger output options. It supports any combination of content described here: https://log4cplus.sourceforge.io/docs/html/classlog4cplus_1_1PatternLayout.html src/lib/log/output_option.* Added constants to define default patterns: OutputOption::DEFAULT_CONSOLE_PATTERN = "%D{%Y-%m-%d %H:%M:%S.%q} %-5p [%c/%i] %m\n"; OutputOption::DEFAULT_FILE_PATTERN = "%D{%Y-%m-%d %H:%M:%S.%q} %-5p [%c/%i] %m\n"; OutputOption::DEFAULT_SYSLOG_PATTERN = "%-5p [%c] %m\n"; OutputOption::pattern_ - new member for conveying pattern string src/lib/log/logger_manager_impl.* LoggerManagerImpl::createConsoleAppender() LoggerManagerImpl::createFileAppender() LoggerManagerImpl::createSyslogAppender() uses either paramater, option.pattern, or the appropriate default pattern LoggerManagerImpl::setAppenderLayout() - new, common method to set the layout, accepts a pattern string parameter LoggerManagerImpl::setConsoleAppenderLayout() LoggerManagerImpl::setSyslogAppenderLayout() - deleted src/lib/process/log_parser.cc LogConfigParser::parseOutputOptions() - now supports pattern src/lib/process/logging_info.* LoggingDestination::pattern_ - new member for conveying pattern string src/bin/dhcp4/dhcp4_lexer.ll src/bin/dhcp4/dhcp4_parser.yy Added "pattern" to the parser grammar
Diffstat (limited to 'src/lib/process/log_parser.cc')
-rw-r--r--src/lib/process/log_parser.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/process/log_parser.cc b/src/lib/process/log_parser.cc
index dd3203a8fb..6c05058bc0 100644
--- a/src/lib/process/log_parser.cc
+++ b/src/lib/process/log_parser.cc
@@ -150,6 +150,11 @@ void LogConfigParser::parseOutputOptions(std::vector<LoggingDestination>& destin
dest.flush_ = flush_ptr->boolValue();
}
+ isc::data::ConstElementPtr pattern = output_option->get("pattern");
+ if (pattern) {
+ dest.pattern_ = pattern->stringValue();
+ }
+
destination.push_back(dest);
}
}