19bool logging_init_state =
false;
29 return (logging_init_state);
37 logging_init_state = state;
44 const char* file,
bool buffer) {
58 const string DEVNULL =
"/dev/null";
59 const string STDOUT =
"stdout";
60 const string STDERR =
"stderr";
61 const string SYSLOG =
"syslog";
62 const string SYSLOG_COLON =
"syslog:";
68 const char* destination = getenv(
"KEA_LOGGER_DESTINATION");
69 const string dest((destination == NULL) ? DEVNULL : destination);
83 }
else if (dest == STDERR) {
87 }
else if (dest == SYSLOG) {
92 }
else if (dest.find(SYSLOG_COLON) == 0) {
95 if (dest == SYSLOG_COLON) {
96 cerr <<
"**ERROR** value for KEA_LOGGER_DESTINATION of " <<
97 SYSLOG_COLON <<
" is invalid, " << SYSLOG <<
98 " will be used instead\n";
103 option.
facility = dest.substr(SYSLOG_COLON.size());
static void init(const std::string &root, isc::log::Severity severity=isc::log::INFO, int dbglevel=0, const char *file=NULL, bool buffer=false)
Run-Time Initialization.
void process(T start, T finish)
Process Specifications.
void addOutputOption(const OutputOption &option)
Add output option.
Logging initialization functions.
void setLoggingInitialized(bool state)
Set state of "logging initialized" flag.
const std::string & getRootLoggerName()
Get root logger name.
void initLogger(const string &root, isc::log::Severity severity, int dbglevel, const char *file, bool buffer)
Run-time initialization.
bool isLoggingInitialized()
Is logging initialized?
const int MAX_DEBUG_LEVEL
int keaLoggerDbglevel(int defdbglevel)
Obtains logging debug level from KEA_LOGGER_DBGLEVEL.
void setDefaultLoggingOutput(bool verbose)
Reset root logger characteristics.
isc::log::Severity keaLoggerSeverity(isc::log::Severity defseverity)
Obtains logging severity from KEA_LOGGER_SEVERITY.
Defines the logger used by the top-level component of kea-lfc.
Destination destination
Members.
std::string facility
syslog facility
Stream stream
stdout/stderr if console output
std::string filename
Filename if file output.