Kea 2.5.9
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.
Definition: output_option.h:55
Destination destination
Members.
Definition: output_option.h:68
std::string pattern
log content pattern
Definition: output_option.h:75
Destination
Destinations.
Definition: output_option.h:48
bool flush
true to flush after each message
Definition: output_option.h:70
static const std::string DEFAULT_FILE_PATTERN
Default layout pattern for file logs.
Definition: output_option.h:42
OutputOption()
Constructor.
Definition: output_option.h:61
unsigned int maxver
Maximum versions (none if <= 0)
Definition: output_option.h:74
std::string facility
syslog facility
Definition: output_option.h:71
uint64_t maxsize
0 if no maximum size
Definition: output_option.h:73
Stream stream
stdout/stderr if console output
Definition: output_option.h:69
static const std::string DEFAULT_SYSLOG_PATTERN
Default layout pattern for syslog logs.
Definition: output_option.h:44
std::string filename
Filename if file output.
Definition: output_option.h:72
static const std::string DEFAULT_CONSOLE_PATTERN
Default layout pattern for console logs.
Definition: output_option.h:40