MySQL 8.0.40
Source Code Documentation
|
#include "mysql/harness/logging/logger_plugin.h"
#include <sstream>
#include <vector>
#include "consolelog_plugin.h"
#include "dim.h"
#include "filelog_plugin.h"
#include "mysql/harness/logging/supported_logger_options.h"
#include "mysql/harness/string_utils.h"
#include "mysql/harness/utility/string.h"
#include "syslog_plugin.h"
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 std::string &sink_name, const mysql_harness::LoaderConfig &config, const std::string &default_log_filename, const mysql_harness::logging::LogLevel default_log_level, const mysql_harness::logging::LogTimestampPrecision default_log_timestamp_precision) |
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 | 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) |
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 |
|
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 |