To use the JSON format for logging, you need to load the JSON log writer called log_sink_json. You can use the built-in filter, log_filter_internal, for filtering:
- Install the JSON log writer:
mysql> INSTALL COMPONENT 'file://component_log_sink_json';Query OK, 0 rows affected (0.05 sec)
- Make it persistent across restarts:
mysql> SET PERSIST log_error_services = 'log_filter_internal; log_sink_json';Query OK, 0 rows affected (0.00 sec)
- The JSON log writer determines its output destination based on the default error log destination, which is given by the log_error system variable:
mysql> SHOW VARIABLES LIKE 'log_error';+---------------+---------------------------+| Variable_name | Value |+---------------+---------------------------+ ...