MySQL  8.0.19
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 int open (const char *name, int option, int facility) noexcept
 Wrapper for mysys' my_openlog. More...
static int write (enum loglevel level, const char *msg) noexcept
 Wrapper for mysys' my_syslog. More...
static int close (void) noexcept
 Wrapper for mysys' my_closelog. More...

Detailed Description

Syslog/Eventlog functions for logging services.

Member Function Documentation

◆ close()

int log_builtins_syseventlog_imp::close ( void  )

Wrapper for mysys' my_closelog.

Closes/de-registers the system logging handle.

Return values

◆ open()

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

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.

nameName of the event source / syslog ident.
optionMY_SYSLOG_PIDS to log PID with each message.
facilityType of program. Passed to openlog().
Return values
-1Error, log not opened
-2Error, not updated, using previous values

◆ write()

int log_builtins_syseventlog_imp::write ( enum loglevel  level,
const char *  msg 

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.

levelLog level
msgMessage to be logged
Return values

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