content_image/771545.jpg
To set log_error_services  to take effect at server startup, use the instructions at Section 5.4.2.1, “Error Log Configuration” . Those instructions apply to other error-logging system variables as well. 

It is permitted to name log_sink_json  multiple times in the log_error_services  value. For example, to write unfiltered events with one instance and filtered events with another instance, you could set log_error_services  like this: 

SET PERSIST log_error_services = ’log_sink_json; log_filter_internal; log_sink_json’; 

The JSON sink determines its output destination based on the default error log destination, which is given by the log_error  system variable. If log_error  names a file, the JSON sink bases output file naming on that file name, plus a numbered . NN .json  suffix, with NN  starting at 00. For example, if log_error  is file_name , successive instances of log_sink_json  named in the log_error_services  value write to file_name .00.json , file_name .01.json , and so forth. 

If log_error  is stderr , the JSON sink writes to the console. If log_sink_json  is named multiple times in the log_error_services  value, they all write to the console, which is likely not useful. 

## 5.4.2.8 Error Logging to the System Log 

It is possible to have mysqld  write the error log to the system log (the Event Log on Windows, and syslog  on Unix and Unix-like systems). 

This section describes how to configure error logging using the built-in filter, log_filter_internal , and the system log sink, log_sink_syseventlog , to take effect immediately and for subsequent server startups. For general information about configuring error logging, see Section 5.4.2.1, “Error Log Configuration” . 

To enable the system log sink, first load the sink component, then modify the log_error_services value: 

INSTALL COMPONENT ’file://component_log_sink_syseventlog’; SET PERSIST log_error_services = ’log_filter_internal; log_sink_syseventlog’; 

To set log_error_services  to take effect at server startup, use the instructions at Section 5.4.2.1, “Error Log Configuration” . Those instructions apply to other error-logging system variables as well. 

<img src='content_image/771545.jpg'>

## Note 

For MySQL 8.0 configuration, you must enable error logging to the system log explicitly. This differs from MySQL 5.7 and earlier, for which error logging to the system log is enabled by default on Windows, and on all platforms requires no component loading. 

Error logging to the system log may require additional system configuration. Consult the system log documentation for your platform. 

On Windows, error messages written to the Event Log within the Application log have these characteristics: 

•Entries marked as Error , Warning , and Note  are written to the Event Log, but not messages such as information statements from individual storage engines. 

•Event Log entries have a source of MySQL  (or MySQL- tag  if syseventlog.tag  is defined as tag ). 

On Unix and Unix-like systems, logging to the system log uses syslog . The following system variables affect syslog  messages: 

• syseventlog.facility : The default facility for syslog  messages is daemon . Set this variable to specify a different facility. 

1041 

