Kea 2.7.5
output_option.h
Go to the documentation of this file.
1// Copyright (C) 2011-2021 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 OUTPUT_OPTION_H
8#define OUTPUT_OPTION_H
9
10#include <stdint.h>
11#include <stdlib.h>
12#include <string>
13
33
34namespace isc {
35namespace log {
36
38
40 static const std::string DEFAULT_CONSOLE_PATTERN;
42 static const std::string DEFAULT_FILE_PATTERN;
44 static const std::string DEFAULT_SYSLOG_PATTERN;
45
48 typedef enum {
51 DEST_SYSLOG = 2
53
55 typedef enum {
57 STR_STDERR = 2
59
62 flush(true), facility("LOCAL0"), filename(""),
63 maxsize(0), maxver(0), pattern("")
64 {}
65
67
70 bool flush;
71 std::string facility;
72 std::string filename;
73 uint64_t maxsize;
74 unsigned int maxver;
75 std::string pattern;
76};
77
78OutputOption::Destination getDestination(const std::string& dest_str);
79OutputOption::Stream getStream(const std::string& stream_str);
80
81
82} // namespace log
83} // namespace isc
84
85#endif // OUTPUT_OPTION_H
OutputOption::Destination getDestination(const std::string &dest_str)
OutputOption::Stream getStream(const std::string &stream_str)
Defines the logger used by the top-level component of kea-lfc.
Stream
If console, stream on which messages are output.
Destination destination
Members.
std::string pattern
log content pattern
bool flush
true to flush after each message
static const std::string DEFAULT_FILE_PATTERN
Default layout pattern for file logs.
OutputOption()
Constructor.
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
static const std::string DEFAULT_SYSLOG_PATTERN
Default layout pattern for syslog logs.
std::string filename
Filename if file output.
static const std::string DEFAULT_CONSOLE_PATTERN
Default layout pattern for console logs.