MySQL  8.0.18
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  )
staticnoexcept

Wrapper for mysys' my_closelog.

Closes/de-registers the system logging handle.

Return values
0Success
<>0Error

◆ open()

int 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
0Success
-1Error, log not opened
-2Error, not updated, using previous values

◆ write()

int 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
0Success
<>0Error

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