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:";
25 return (
output_ == other.output_ &&
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;
91 for (
auto const& dest_other : other.destinations_) {
92 if (dest.equals(dest_other)) {
104 return (
name_ == other.name_ &&
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());
146 option.filename = dest.output_;
147 option.maxsize = dest.maxsize_;
148 option.maxver = dest.maxver_;
152 option.flush = dest.flush_;
155 option.pattern = dest.pattern_;
158 spec.addOutputOption(option);
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.
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.
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.