Error events intended for the error log contain a set of fields, each of which consists of a key/value pair. An event field may be classified as core, optional, or user-defined:
A core field is set up automatically for error events. However, its presence in the event during event processing is not guaranteed because a core field, like any type of field, may be unset by a log filter. If this happens, the field cannot be found by subsequent processing within that filter and by components that execute after the filter (such as log sinks).
An optional field is normally absent but may be present for certain event types. When present, an optional field provides additional event information as appropriate and available.
A user-defined field is any field with a name that is not already defined as a core or optional field. A user-defined field does not exist until created by a log filter.
As implied by the preceding description, any given field may be absent during event processing, either because it was not present in the first place, or was discarded by a filter. For log sinks, the effect of field absence is sink specific. For example, a sink might omit the field from the log message, indicate that the field is missing, or substitute a default. When in doubt, test: use a filter that unsets the field, then check what the log sink does with it.
The following sections describe the core and optional error event fields. For individual log filter components, there may be additional filter-specific considerations for these fields, or filters may add user-defined fields not listed here. For details, see the documentation for specific filters.
These error event fields are core fields:
timeThe event timestamp, with microsecond precision.
msgThe event message string.
prioThe event priority, to indicate a system, error, warning, or note/information event. This field corresponds to severity in
syslog. The following table shows the possible priority levels.Event Type Numeric Priority System event 0 Error event 1 Warning event 2 Note/information event 3 The
priovalue is numeric. Related to it, an error event may also include an optionallabelfield representing the priority as a string. For example, an event with apriovalue of 2 may have alabelvalue of'Warning'.Filter components may include or drop error events based on priority, except that system events are mandatory and cannot be dropped.
In general, message priorities are determined as follows:
Is the situation or event actionable?
Yes: Is the situation or event ignorable?
Yes: Priority is warning.
No: Priority is error.
No: Is the situation or event mandatory?
Yes: Priority is system.
No: Priority is note/information.
err_codeThe event error code, as a number (for example,
1022).err_symbolThe event error symbol, as a string (for example,
'ER_DUP_KEY').SQL_stateThe event SQLSTATE value, as a string (for example,
'23000').subsystemThe subsystem in which the event occurred. Possible values are
InnoDB(theInnoDBstorage engine),Repl(the replication subsystem),Server(otherwise).
Optional error event fields fall into the following categories:
Additional information about the error, such as the error signaled by the operating system or the error label:
OS_errnoThe operating system error number.
OS_errmsgThe operating system error message.
labelThe label corresponding to the
priovalue, as a string.
Identification of the client for which the event occurred:
userThe client user.
hostThe client host.
threadThe ID of the thread within mysqld responsible for producing the error event. This ID indicates which part of the server produced the event, and is consistent with general query log and slow query log messages, which include the connection thread ID.
query_idThe query ID.
Debugging information:
source_fileThe source file in which the event occurred, without any leading path.
source_lineThe line within the source file at which the event occurred.
functionThe function in which the event occurred.
componentThe component or plugin in which the event occurred.