25#ifndef MYSQL_HARNESS_SYSLOG_PLUGIN_INCLUDED
26#define MYSQL_HARNESS_SYSLOG_PLUGIN_INCLUDED
30#include "mysql/harness/plugin.h"
56 void open(
const std::string &ident)
noexcept {
59 openlog(
ident_, LOG_CONS | LOG_NDELAY, LOG_DAEMON);
62 void close() const noexcept { closelog(); }
65 void reopen(
const std::string )
override {}
74 case LogLevel::kFatal:
76 case LogLevel::kError:
78 case LogLevel::kWarning:
82 case LogLevel::kSystem:
86 assert(level == LogLevel::kDebug);
Unix-based systems specific logging handler(sink) that writes the logs to the syslog.
Definition: syslog_plugin.h:47
SyslogHandler(bool format_messages=true, LogLevel level=LogLevel::kNotSet)
Definition: syslog_plugin.h:51
static constexpr unsigned kMaxIdentSize
Definition: syslog_plugin.h:49
void open(const std::string &ident) noexcept
Definition: syslog_plugin.h:56
void close() const noexcept
Definition: syslog_plugin.h:62
static int log_level_to_syslog(const LogLevel level) noexcept
Definition: syslog_plugin.h:72
~SyslogHandler() override
Definition: syslog_plugin.h:54
char ident_[kMaxIdentSize]
Definition: syslog_plugin.h:91
void reopen(const std::string) override
Request to reopen underlying log sink.
Definition: syslog_plugin.h:65
void do_log(const mysql_harness::logging::Record &record) noexcept override
Log message handler primitive.
Definition: syslog_plugin.h:68
Base class for log message handler.
Definition: handler.h:49
Logging interface for using and extending the logging subsystem.
static int record
Definition: mysqltest.cc:194
LogLevel
Log level values.
Definition: logging.h:95
LogTimestampPrecision
Log timestamp precision values.
Definition: logging.h:160
Log record containing information collected by the logging system.
Definition: logging.h:182
mysql_harness::Plugin harness_plugin_syslog
Definition: syslog_plugin.cc:32
constexpr const char * kSyslogPluginName
Definition: syslog_plugin.h:35