18static const std::string STDOUT =
"stdout";
19static const std::string STDERR =
"stderr";
20static const std::string SYSLOG =
"syslog";
21static const std::string SYSLOG_COLON =
"syslog:";
46 (
output_.find(SYSLOG_COLON) == std::string::npos)) {
58 :
name_(
"kea"), severity_(
isc::log::
INFO), debuglevel_(0) {
69 if (!default_logger.empty()) {
70 name_ = default_logger;
92 if (dest.equals(dest_other)) {
117 if (dest.output_ == STDOUT) {
121 }
else if (dest.output_ == STDERR) {
125 }
else if (dest.output_ == SYSLOG) {
130 }
else if (dest.output_.find(SYSLOG_COLON) == 0) {
133 if (dest.output_ == SYSLOG_COLON) {
140 option.
facility = dest.output_.substr(SYSLOG_COLON.size());
147 option.
maxsize = dest.maxsize_;
148 option.
maxver = dest.maxver_;
152 option.
flush = dest.flush_;
155 option.
pattern = dest.pattern_;
175 options->add(dest.toElement());
177 result->set(
"output-options", options);
180 std::string severity;
static ElementPtr create(const Position &pos=ZERO_POSITION())
static ElementPtr createMap(const Position &pos=ZERO_POSITION())
Creates an empty MapElement type ElementPtr.
static ElementPtr createList(const Position &pos=ZERO_POSITION())
Creates an empty ListElement type ElementPtr.
void addOutputOption(const OutputOption &option)
Add output option.
static bool getVerbose()
Returns if running in verbose mode.
static std::string getDefaultLoggerName()
Returns default logger name.
structure that describes one logging entry
LoggingInfo()
Default constructor.
int debuglevel_
debuglevel (used when severity_ == DEBUG)
bool equals(const LoggingInfo &other) const
Compares two objects for equality.
isc::log::LoggerSpecification toSpec() const
Converts logger configuration to a spec.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
std::string name_
logging name
std::vector< LoggingDestination > destinations_
specific logging destinations
isc::log::Severity severity_
describes logging severity
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
boost::shared_ptr< Element > ElementPtr
const std::string & getDefaultRootLoggerName()
Returns the default ('kea') root logger name.
Defines the logger used by the top-level component of kea-lfc.
void contextToElement(data::ElementPtr map) const
Merge unparse a user_context object.
Destination destination
Members.
std::string pattern
log content pattern
bool flush
true to flush after each message
unsigned int maxver
Maximum versions (none if <= 0)
std::string facility
syslog facility
uint64_t maxsize
0 if no maximum size
Stream stream
stdout/stderr if console output
std::string filename
Filename if file output.
Defines single logging destination.
int maxver_
Maximum number of log files in rotation.
std::string output_
defines logging destination output
std::string pattern_
defines the log format pattern It dictates what additional elements are output
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
bool equals(const LoggingDestination &other) const
Compares two objects for equality.
uint64_t maxsize_
Maximum log file size.
bool flush_
Immediate flush.