MySQL 9.0.0
Source Code Documentation
log_builtins_internal.h File Reference

Go to the source code of this file.

Classes

struct  log_service_cache_entry
 Finding and acquiring a service in the component framework is expensive, and we may use services a log (depending on how many events are logged per second), so we cache the relevant data. More...
 
struct  _log_service_instance
 State of a given instance of a service. More...
 
struct  _log_item_iter
 Iterator over the key/value pairs of a log_line. More...
 
struct  _log_line
 log_line ("log event") More...
 

Macros

#define LOG_ITEM_MAX   64
 Maximum number of key/value pairs in a log event. More...
 

Typedefs

typedef struct _log_service_instance log_service_instance
 State of a given instance of a service. More...
 
typedef struct _log_item_iter log_item_iter
 Iterator over the key/value pairs of a log_line. More...
 
typedef struct _log_line log_line
 log_line ("log event") More...
 

Functions

ulonglong log_builtins_started ()
 When the logger-core was initialized. More...
 
bool log_line_error_stack_run (log_line *ll)
 MySQL server's default log-processor. More...
 
log_service_error make_log_path (char *result, const char *name_or_ext)
 Create a log-file name (path + name + extension). More...
 
void log_builtins_error_stack_wrlock ()
 Acquire an exclusive lock on the error logger core. More...
 
void log_builtins_error_stack_unlock ()
 Release a lock on the error logger core. More...
 

Variables

log_service_instancelog_service_instances
 anchor More...
 
log_service_instancelog_sink_pfs_source
 log-reader More...
 
log_filter_rulesetlog_filter_builtin_rules
 

Macro Definition Documentation

◆ LOG_ITEM_MAX

#define LOG_ITEM_MAX   64

Maximum number of key/value pairs in a log event.

May be changed or abolished later.

Typedef Documentation

◆ log_item_iter

typedef struct _log_item_iter log_item_iter

Iterator over the key/value pairs of a log_line.

At present, only one iter may exist per log_line.

◆ log_line

typedef struct _log_line log_line

log_line ("log event")

◆ log_service_instance

State of a given instance of a service.

A service may support being opened several times.

Function Documentation

◆ log_builtins_error_stack_unlock()

void log_builtins_error_stack_unlock ( )

Release a lock on the error logger core.

◆ log_builtins_error_stack_wrlock()

void log_builtins_error_stack_wrlock ( )

Acquire an exclusive lock on the error logger core.

Used e.g. to pause all logging while the previous run's log is read to performance_schema.error_log.

◆ log_builtins_started()

ulonglong log_builtins_started ( )

When the logger-core was initialized.

Return values
0logger-core is not currently available
>0time (micro-seconds since the epoch) the logger became available

◆ log_line_error_stack_run()

bool log_line_error_stack_run ( log_line ll)

MySQL server's default log-processor.

Apply all components (filters, sinks, ...) in the log stack to a given event.

Parameters
llthe log-event to process
Return values
truefailure
falsesuccess

◆ make_log_path()

log_service_error make_log_path ( char *  result,
const char *  name_or_ext 
)

Create a log-file name (path + name + extension).

The path will be taken from @log_error. If name + extension are given, they are used. If only an extension is given (argument starts with '.'), the name is taken from @log_error, and the extension is used. If only a name is given (but no extension), the name and a default extension are used.

Parameters
resultBuffer to return to created path+name+extension in. Size must be FN_REFLEN.
name_or_extif beginning with '.': @global.log_error, except with this extension otherwise: use this as file name in the same location as @global.log_error

Value may not contain folder separators!

Return values
LOG_SERVICE_SUCCESSbuffer contains a valid result
LOG_SERVICE_BUFFER_SIZE_INSUFFICIENTan error occurred

Variable Documentation

◆ log_filter_builtin_rules

log_filter_ruleset* log_filter_builtin_rules
extern

◆ log_service_instances

log_service_instance* log_service_instances
extern

anchor

anchor

(Each service can have no/one/several instances.)

◆ log_sink_pfs_source

log_service_instance* log_sink_pfs_source
extern

log-reader

log-reader