MySQL 8.0.39
Source Code Documentation
log_service.h File Reference

Go to the source code of this file.

Classes

struct  s_mysql_log_service
 

Typedefs

typedef enum enum_log_service_chistics log_service_chistics
 This defines the API used to call functions in logging components. More...
 
typedef enum enum_log_service_error log_service_error
 Error codes. More...
 
typedef struct s_mysql_log_service mysql_service_log_service_t
 

Enumerations

enum  enum_log_service_chistics {
  LOG_SERVICE_UNSPECIFIED = 0 , LOG_SERVICE_READ_ONLY = 1 , LOG_SERVICE_SINGLETON = 2 , LOG_SERVICE_BUILTIN = 4 ,
  LOG_SERVICE_SOURCE = 128 , LOG_SERVICE_FILTER = 256 , LOG_SERVICE_SINK = 512 , LOG_SERVICE_PFS_SUPPORT = 1024 ,
  LOG_SERVICE_LOG_PARSER = 2048
}
 This defines the API used to call functions in logging components. More...
 
enum  enum_log_service_error {
  LOG_SERVICE_SUCCESS = 0 , LOG_SERVICE_MISC_ERROR = -1 , LOG_SERVICE_NOTHING_DONE = -2 , LOG_SERVICE_BUFFER_SIZE_INSUFFICIENT = -10 ,
  LOG_SERVICE_OUT_OF_MEMORY = -11 , LOG_SERVICE_NOT_AVAILABLE = -20 , LOG_SERVICE_UNSUPPORTED_MODE = -21 , LOG_SERVICE_INVALID_ARGUMENT = -30 ,
  LOG_SERVICE_ARGUMENT_TOO_LONG = -31 , LOG_SERVICE_PARSE_ERROR = -32 , LOG_SERVICE_COULD_NOT_MAKE_LOG_NAME = -40 , LOG_SERVICE_LOCK_ERROR = -50 ,
  LOG_SERVICE_UNABLE_TO_WRITE = -60 , LOG_SERVICE_UNABLE_TO_READ = -61 , LOG_SERVICE_OPEN_FAILED = -62 , LOG_SERVICE_CLOSE_FAILED = -63 ,
  LOG_SERVICE_SEEK_FAILED = -64 , LOG_SERVICE_TOO_MANY_INSTANCES = -99
}
 Error codes. More...
 

Typedef Documentation

◆ log_service_chistics

This defines the API used to call functions in logging components.

When implementing such a service, refer to log_service_imp.h instead!

A log service may take the shape of a writer for a specific log format (JSON, XML, traditional MySQL, etc.), it may implement a filter that removes or modifies log_items, etc.

◆ log_service_error

Error codes.

These are grouped (general issues, invalid data, file ops, etc.). Each group has a sparsely populated range so we may add entries as needed without introducing incompatibility by renumbering the existing ones.

◆ mysql_service_log_service_t

Enumeration Type Documentation

◆ enum_log_service_chistics

This defines the API used to call functions in logging components.

When implementing such a service, refer to log_service_imp.h instead!

A log service may take the shape of a writer for a specific log format (JSON, XML, traditional MySQL, etc.), it may implement a filter that removes or modifies log_items, etc.

Enumerator
LOG_SERVICE_UNSPECIFIED 

We do not have information about this service yet.

LOG_SERVICE_READ_ONLY 

Service is read-only – it guarantees it will not modify the log-event.

This information may later be used to e.g. run log-writers in parallel.

LOG_SERVICE_SINGLETON 

Service is a singleton – it may occur in the log service pipeline only once.

LOG_SERVICE_BUILTIN 

Service is built-in (and can not be INSTALLed/UNINSTALLed.

LOG_SERVICE_SOURCE 

Service is a source.

It adds key/value pairs beyond those in the statement that first created the log-event. Log-sources are not normally READ_ONLY.

LOG_SERVICE_FILTER 

Service is a filter.

A filter should not be the last service in the log service pipeline.

LOG_SERVICE_SINK 

Service is a sink (usually a log-writer).

Sinks will normally not modify the log-event, but be READ_ONLY.

LOG_SERVICE_PFS_SUPPORT 

Service supports the performance_schema.error_log table.

If the caller provides a buffer, the service will write output to be displayed in the performance-schema table there. This can be the entirety of the log-entry, or a projection thereof (usually omitting key/value pairs that are already shown in other columns of said table). Services flagged this must also be flagged LOG_SERVICE_SINK!

LOG_SERVICE_LOG_PARSER 

Service can parse lines in the format it outputs.

Services flagged this must also be flagged LOG_SERVICE_SINK | LOG_SERVICE_PFS_SUPPORT!

◆ enum_log_service_error

Error codes.

These are grouped (general issues, invalid data, file ops, etc.). Each group has a sparsely populated range so we may add entries as needed without introducing incompatibility by renumbering the existing ones.

Enumerator
LOG_SERVICE_SUCCESS 

no error

LOG_SERVICE_MISC_ERROR 

error not otherwise specified

LOG_SERVICE_NOTHING_DONE 

no error, but no effect either

LOG_SERVICE_BUFFER_SIZE_INSUFFICIENT 

arguments are valid, we just don't have the space (either pre-allocated in this function, or passed to us by the caller)

LOG_SERVICE_OUT_OF_MEMORY 

we cannot allocate a (temporary or return) buffer of the required size

LOG_SERVICE_NOT_AVAILABLE 

service uninavailable (bad internal state/underlying service unavailable)

LOG_SERVICE_UNSUPPORTED_MODE 

for a method with modes, a mode unsupported by this service was requested

LOG_SERVICE_INVALID_ARGUMENT 

argument was invalid (out of range, malformed, etc.)

LOG_SERVICE_ARGUMENT_TOO_LONG 

argument too long (a special case of malformed).

E.g. a path longer than FN_REFLEN, or a presumed data longer than specified in ISO-8601. use LOG_SERVICE_INVALID_ARGUMENT, LOG_SERVICE_BUFFER_SIZE_INSUFFICIENT, or LOG_SERVICE_OUT_OF_MEMORY if more appropriate.

LOG_SERVICE_PARSE_ERROR 

invalid data, but not arguments to a C++ function (bad log-file to parse, filter language statement, etc.)

LOG_SERVICE_COULD_NOT_MAKE_LOG_NAME 

could not make log name

LOG_SERVICE_LOCK_ERROR 

lock error (could not init, or is not inited, etc.)

LOG_SERVICE_UNABLE_TO_WRITE 

can not write

LOG_SERVICE_UNABLE_TO_READ 
LOG_SERVICE_OPEN_FAILED 
LOG_SERVICE_CLOSE_FAILED 
LOG_SERVICE_SEEK_FAILED 
LOG_SERVICE_TOO_MANY_INSTANCES 

no more instances of this service are possible.