MySQL 8.0.31
Source Code Documentation
eventlog_plugin.cc File Reference
#include "mysql/harness/logging/eventlog_plugin.h"
#include "eventlog_rc/message.h"
#include "mysql/harness/logging/logger_plugin.h"
#include "mysql/harness/logging/registry.h"
#include "mysql/harness/logging/supported_logger_options.h"
#include "mysql/harness/plugin.h"
#include <Windows.h>
#include <cstdarg>

Functions

static WORD logger_to_eventlog_severity (LogLevel level)
 
static void create_eventlog_registry_entry (const std::string &event_source_name)
 Create a key in the Windows registry. More...
 

Variables

constexpr const char * kRegistryPrefix
 
mysql_harness::Plugin harness_plugin_eventlog
 

Function Documentation

◆ create_eventlog_registry_entry()

static void create_eventlog_registry_entry ( const std::string &  event_source_name)
static

Create a key in the Windows registry.

We'll setup a "MySQL Router" key in the EventLog branch (RegCreateKey), set our executable name (GetModuleFileName) as file-name ("EventMessageFile"), then set the message types we expect to be logging ("TypesSupported"). If the key does not exist, sufficient privileges will be required to create and configure it. If the key does exist, opening it should be unprivileged; modifying will fail on insufficient privileges, but that is non-fatal.

◆ logger_to_eventlog_severity()

static WORD logger_to_eventlog_severity ( LogLevel  level)
static

Variable Documentation

◆ harness_plugin_eventlog

mysql_harness::Plugin harness_plugin_eventlog
Initial value:
= {
mysql_harness::PLUGIN_ABI_VERSION,
mysql_harness::ARCHITECTURE_DESCRIPTOR,
"Logging using eventlog",
VERSION_NUMBER(0, 0, 1),
0,
nullptr,
0,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
false,
}
static constexpr std::array< const char *, 4 > logger_sink_supported_options
Definition: supported_logger_options.h:32

◆ kRegistryPrefix

constexpr const char* kRegistryPrefix
constexpr
Initial value:
=
"SYSTEM\\CurrentControlSet\\services\\eventlog\\Application\\"