MySQL 8.0.39
Source Code Documentation
log_builtins_syseventlog_imp Class Reference

Syslog/Eventlog functions for logging services. More...

#include <log_builtins_imp.h>

Static Public Member Functions

static log_service_error open (const char *name, int option, int facility) noexcept
 Wrapper for mysys' my_openlog. More...
 
static log_service_error write (enum loglevel level, const char *msg) noexcept
 Wrapper for mysys' my_syslog. More...
 
static log_service_error close (void) noexcept
 Wrapper for mysys' my_closelog. More...
 

Detailed Description

Syslog/Eventlog functions for logging services.

Member Function Documentation

◆ close()

log_service_error log_builtins_syseventlog_imp::close ( void  )
staticnoexcept

Wrapper for mysys' my_closelog.

Closes/de-registers the system logging handle.

Return values
LOG_SERVICE_SUCCESSSuccess
otherwiseError

◆ open()

log_service_error log_builtins_syseventlog_imp::open ( const char *  name,
int  option,
int  facility 
)
staticnoexcept

Wrapper for mysys' my_openlog.

Opens/Registers a new handle for system logging. Note: It's a thread-unsafe function. It should either be invoked from the main thread or some extra thread safety measures need to be taken.

Parameters
nameName of the event source / syslog ident.
optionMY_SYSLOG_PIDS to log PID with each message.
facilityType of program. Passed to openlog().
Return values
LOG_SERVICE_SUCCESSSuccess
LOG_SERVICE_NOT_AVAILABLEError, log not opened
LOG_ERROR_NOTHING_DONEError, not updated, using previous values

◆ write()

log_service_error log_builtins_syseventlog_imp::write ( enum loglevel  level,
const char *  msg 
)
staticnoexcept

Wrapper for mysys' my_syslog.

Sends message to the system logger. On Windows, the specified message is internally converted to UCS-2 encoding, while on other platforms, no conversion takes place and the string is passed to the syslog API as it is.

Parameters
levelLog level
msgMessage to be logged
Return values
LOG_SERVICE_SUCCESSSuccess
otherwiseError, nothing logged

The documentation for this class was generated from the following files: