Kea 2.2.0
logger_manager_impl.h
Go to the documentation of this file.
1// Copyright (C) 2011-2019 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.
16namespace log4cplus {
17class Logger;
18class Appender;
19}
20
21namespace isc {
22namespace log {
23
24// Forward declarations
25class LoggerSpecification;
26struct OutputOption;
27
41
43public:
44
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
96private:
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
157 static void setAppenderLayout(log4cplus::SharedAppenderPtr& appender,
158 std::string pattern);
159
166 void storeBufferAppenders();
167
172 void flushBufferAppenders();
173
177 std::vector<log4cplus::SharedAppenderPtr> buffer_appender_store_;
178};
179
180} // namespace log
181} // namespace isc
182
183#endif // LOGGER_MANAGER_IMPL_H
Logger Manager Implementation.
static void processSpecification(const LoggerSpecification &spec)
Process Specification.
void processEnd()
End Processing.
static void init(isc::log::Severity severity=isc::log::INFO, int dbglevel=0, bool buffer=false)
Implementation-specific initialization.
static void reset(isc::log::Severity severity=isc::log::INFO, int dbglevel=0)
Reset logging.
void processInit()
Initialize Processing.
isc::log::Logger logger("asiodns")
Use the ASIO logger.
Severity
Severity Levels.
Definition: logger_level.h:23
Defines the logger used by the top-level component of kea-lfc.