MySQL 9.1.0
Source Code Documentation
|
#include "mysql/harness/logging/logger_plugin.h"
#include <iostream>
#include <sstream>
#include <vector>
#include "consolelog_plugin.h"
#include "dim.h"
#include "filelog_plugin.h"
#include "mysql/harness/dynamic_config.h"
#include "mysql/harness/logging/supported_logger_options.h"
#include "mysql/harness/plugin_config.h"
#include "mysql/harness/section_config_exposer.h"
#include "mysql/harness/string_utils.h"
#include "mysql/harness/supported_config_options.h"
#include "mysql/harness/utility/string.h"
#include "syslog_plugin.h"
Classes | |
class | anonymous_namespace{logger_plugin.cc}::LoggingPluginConfig |
class | anonymous_namespace{logger_plugin.cc}::LoggerConfigExposer |
Namespaces | |
namespace | anonymous_namespace{logger_plugin.cc} |
Macros | |
#define | MYSQL_ROUTER_LOG_DOMAIN "logger" |
#define | NULL_DEVICE_NAME "/dev/null" |
#define | STDOUT_DEVICE_NAME "/dev/stdout" |
#define | STDERR_DEVICE_NAME "/dev/stderr" |
#define | LEGAL_DESTINATION_DEVICE_NAMES NULL_DEVICE_NAME ", " STDOUT_DEVICE_NAME ", " STDERR_DEVICE_NAME |
Typedefs | |
using | HandlerPtr = std::shared_ptr< mysql_harness::logging::Handler > |
using | LoggerHandlersList = std::vector< std::pair< std::string, HandlerPtr > > |
Functions | |
static bool | legal_consolelog_destination (const std::string &destination) |
HandlerPtr | anonymous_namespace{logger_plugin.cc}::create_logging_sink (const LoggingPluginConfig &config) |
void | create_plugin_loggers (const mysql_harness::LoaderConfig &config, mysql_harness::logging::Registry ®istry, const mysql_harness::logging::LogLevel level) |
Creates the logging handler for each plugin from the configuration. More... | |
void | register_on_switch_to_configured_loggers_callback (on_switch_to_configured_loggers callback) |
Registers the callback that the plugin will execute once it is finished with initialization and switches from the default to the configured logger sink(s). More... | |
static bool | get_sinks_from_config (const mysql_harness::LoaderConfig &config, std::vector< std::string > &out_sinks, std::string &out_default_log_filename, mysql_harness::logging::LogLevel &out_default_log_level, mysql_harness::logging::LogTimestampPrecision &out_default_log_timestamp_precision, std::string &out_err_msg) |
static bool | init_handlers (mysql_harness::PluginFuncEnv *env, const mysql_harness::LoaderConfig &config, LoggerHandlersList &logger_handlers) |
static void | switch_to_loggers_in_config (const mysql_harness::LoaderConfig &config, const LoggerHandlersList &logger_handlers) |
static void | init (mysql_harness::PluginFuncEnv *env) |
static void | expose_configuration (mysql_harness::PluginFuncEnv *env, const char *, bool initial) |
Variables | |
std::vector< on_switch_to_configured_loggers > | g_on_switch_to_configured_loggers_clbs |
mysql_harness::Plugin | harness_plugin_logger |
#define LEGAL_DESTINATION_DEVICE_NAMES NULL_DEVICE_NAME ", " STDOUT_DEVICE_NAME ", " STDERR_DEVICE_NAME |
#define MYSQL_ROUTER_LOG_DOMAIN "logger" |
#define NULL_DEVICE_NAME "/dev/null" |
#define STDERR_DEVICE_NAME "/dev/stderr" |
#define STDOUT_DEVICE_NAME "/dev/stdout" |
using HandlerPtr = std::shared_ptr<mysql_harness::logging::Handler> |
using LoggerHandlersList = std::vector<std::pair<std::string, HandlerPtr> > |
void create_plugin_loggers | ( | const mysql_harness::LoaderConfig & | config, |
mysql_harness::logging::Registry & | registry, | ||
const mysql_harness::logging::LogLevel | level | ||
) |
Creates the logging handler for each plugin from the configuration.
config | configuration containing the plugin names we should create loggers for |
registry | logging registry where the logging handlers should be created |
level | logging level for the newly create logging handlers |
std::logic_error |
|
static |
|
static |
|
static |
|
static |
|
inlinestatic |
void register_on_switch_to_configured_loggers_callback | ( | on_switch_to_configured_loggers | callback | ) |
Registers the callback that the plugin will execute once it is finished with initialization and switches from the default to the configured logger sink(s).
callback | callback to execute |
|
static |
std::vector<on_switch_to_configured_loggers> g_on_switch_to_configured_loggers_clbs |
mysql_harness::Plugin harness_plugin_logger |