Kea: logger_manager_impl.h Source File

| Kea 1.5.0

logger_manager_impl.h
Go to the documentation of this file.
1 // Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7 #ifndef LOGGER_MANAGER_IMPL_H
8 #define LOGGER_MANAGER_IMPL_H
9
10 #include <string>
11
12 #include <log4cplus/appender.h>
13 #include <log/logger_level.h>
14
15 // Forward declaration to avoid need to include log4cplus header file here.
16 namespace log4cplus {
17 class Logger;
18 class Appender;
19 }
20
21 namespace isc {
22 namespace log {
23
24 // Forward declarations
25 class LoggerSpecification;
26 struct OutputOption;
27
41
42 class LoggerManagerImpl {
43 public:
44
46 LoggerManagerImpl() {}
47
53 void processInit();
54
60 static void processSpecification(const LoggerSpecification& spec);
61
65 void processEnd();
66
83 static void init(isc::log::Severity severity = isc::log::INFO,
84 int dbglevel = 0, bool buffer = false);
85
93 static void reset(isc::log::Severity severity = isc::log::INFO,
94 int dbglevel = 0);
95
96 private:
104 static void createConsoleAppender(log4cplus::Logger& logger,
105 const OutputOption& opt);
106
115 static void createFileAppender(log4cplus::Logger& logger,
116 const OutputOption& opt);
117
125 static void createSyslogAppender(log4cplus::Logger& logger,
126 const OutputOption& opt);
127
135 static void createBufferAppender(log4cplus::Logger& logger);
136
147 static void initRootLogger(isc::log::Severity severity = isc::log::INFO,
148 int dbglevel = 0, bool buffer = false);
149
158 static void setConsoleAppenderLayout(log4cplus::SharedAppenderPtr& appender);
159
168 static void setSyslogAppenderLayout(log4cplus::SharedAppenderPtr& appender);
169
176 void storeBufferAppenders();
177
182 void flushBufferAppenders();
183
187 std::vector<log4cplus::SharedAppenderPtr> buffer_appender_store_;
188 };
189
190 } // namespace log
191 } // namespace isc
192
193 #endif // LOGGER_MANAGER_IMPL_H
log4cplus
Definition: logger_manager_impl.h:16
logger_level.h
isc::log::LoggerSpecification
Definition: logger_specification.h:29
isc::log::Severity
Severity
Severity Levels.
Definition: logger_level.h:23
isc::log::LoggerManagerImpl::processInit
void processInit()
Initialize Processing.
Definition: logger_manager_impl.cc:45
isc::log::OutputOption
Definition: output_option.h:37
isc::log::LoggerManagerImpl::processEnd
void processEnd()
End Processing.
Definition: logger_manager_impl.cc:54
isc::log::LoggerManagerImpl::processSpecification
static void processSpecification(const LoggerSpecification &spec)
Process Specification.
Definition: logger_manager_impl.cc:61
isc
Defines the logger used by the top-level component of kea-dhcp-ddns.
Definition: agent_parser.cc:144
isc::log::LoggerManagerImpl::LoggerManagerImpl
LoggerManagerImpl()
Constructor.
Definition: logger_manager_impl.h:46
isc::asiodns::logger
isc::log::Logger logger("asiodns")
Use the ASIO logger.
Definition: asiodns/logger.h:15
isc::log::LoggerManagerImpl::reset
static void reset(isc::log::Severity severity=isc::log::INFO, int dbglevel=0)
Reset logging.
Definition: logger_manager_impl.cc:201
isc::log::LoggerManagerImpl
Logger Manager Implementation.
Definition: logger_manager_impl.h:42
isc::log::INFO
@ INFO
Definition: logger_level.h:26
isc::log::LoggerManagerImpl::init
static void init(isc::log::Severity severity=isc::log::INFO, int dbglevel=0, bool buffer=false)
Implementation-specific initialization.
Definition: logger_manager_impl.cc:181