Rechercher dans le manuel MySQL
5.4.2.6 Error Logging in JSON Format
This section describes how to configure error logging using the
built-in filter, log_filter_internal
, and the
JSON writer, log_sink_json
, to take effect
immediately and for subsequent server startups. For general
information about configuring error logging, see
Section 5.4.2.1, “Error Log Component Configuration”.
To enable the JSON writer, first load the writer component, then
modify the log_error_services
value:
- INSTALL COMPONENT 'file://component_log_sink_json';
To set log_error_services
to
take effect at server startup, use the instructions at
Section 5.4.2.1, “Error Log Component 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:
The JSON log writer 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 writer bases output file naming on that file name, plus a
numbered
.
suffix,
with NN
.jsonNN
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
,
and so forth.
file_name
.01.json
If log_error
is
stderr
, the JSON writer writes to the
console. If log_json_writer
is named multiple
times in the log_error_services
value, they all write to the console, which is likely not
useful.
Document created the 26/06/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/mysql-rf-error-log-json.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.