<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="error-log-event-fields">
      </a>
      7.4.2.3 Error Event Fields
     </h4>
    </div>
   </div>
  </div>
  <p>
   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:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      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).
     </p>
    </li>
    <li class="listitem">
     <p>
      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.
     </p>
    </li>
    <li class="listitem">
     <p>
      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.
     </p>
    </li>
   </ul>
  </div>
  <p>
   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.
  </p>
  <p>
   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.
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="xref" href="error-log-event-fields.html#error-log-event-core-fields" title="Core Error Event Fields">
       Core Error Event Fields
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="error-log-event-fields.html#error-log-event-optional-fields" title="Optional Error Event Fields">
       Optional Error Event Fields
      </a>
     </p>
    </li>
   </ul>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="error-log-event-core-fields">
       </a>
       Core Error Event Fields
      </h5>
     </div>
    </div>
   </div>
   <p>
    These error event fields are core fields:
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <code class="literal">
        time
       </code>
      </p>
      <p>
       The event timestamp, with microsecond precision.
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        msg
       </code>
      </p>
      <p>
       The event message string.
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        prio
       </code>
      </p>
      <p>
       The event priority, to indicate a system, error, warning,
              or note/information event. This field corresponds to
              severity in
       <code class="literal">
        syslog
       </code>
       . The following table
              shows the possible priority levels.
      </p>
      <div class="informaltable">
       <table summary="Error event priority levels.">
        <colgroup>
         <col style="width: 35%"/>
         <col style="width: 35%"/>
        </colgroup>
        <thead>
         <tr>
          <th>
           Event Type
          </th>
          <th>
           Numeric Priority
          </th>
         </tr>
        </thead>
        <tbody>
         <tr>
          <td>
           System event
          </td>
          <td>
           0
          </td>
         </tr>
         <tr>
          <td>
           Error event
          </td>
          <td>
           1
          </td>
         </tr>
         <tr>
          <td>
           Warning event
          </td>
          <td>
           2
          </td>
         </tr>
         <tr>
          <td>
           Note/information event
          </td>
          <td>
           3
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       The
       <code class="literal">
        prio
       </code>
       value is numeric. Related to
              it, an error event may also include an optional
       <code class="literal">
        label
       </code>
       field representing the priority
              as a string. For example, an event with a
       <code class="literal">
        prio
       </code>
       value of 2 may have a
       <code class="literal">
        label
       </code>
       value of
       <code class="literal">
        'Warning'
       </code>
       .
      </p>
      <p>
       Filter components may include or drop error events based
              on priority, except that system events are mandatory and
              cannot be dropped.
      </p>
      <p>
       In general, message priorities are determined as follows:
      </p>
      <p>
       Is the situation or event actionable?
      </p>
      <div class="itemizedlist">
       <ul class="itemizedlist" style="list-style-type: circle; ">
        <li class="listitem">
         <p>
          Yes: Is the situation or event ignorable?
         </p>
         <div class="itemizedlist">
          <ul class="itemizedlist" style="list-style-type: square; ">
           <li class="listitem">
            <p>
             Yes: Priority is warning.
            </p>
           </li>
           <li class="listitem">
            <p>
             No: Priority is error.
            </p>
           </li>
          </ul>
         </div>
        </li>
        <li class="listitem">
         <p>
          No: Is the situation or event mandatory?
         </p>
         <div class="itemizedlist">
          <ul class="itemizedlist" style="list-style-type: square; ">
           <li class="listitem">
            <p>
             Yes: Priority is system.
            </p>
           </li>
           <li class="listitem">
            <p>
             No: Priority is note/information.
            </p>
           </li>
          </ul>
         </div>
        </li>
       </ul>
      </div>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        err_code
       </code>
      </p>
      <p>
       The event error code, as a number (for example,
       <code class="literal">
        1022
       </code>
       ).
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        err_symbol
       </code>
      </p>
      <p>
       The event error symbol, as a string (for example,
       <a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_dup_key" target="_top">
        <code class="literal">
         'ER_DUP_KEY'
        </code>
       </a>
       ).
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        SQL_state
       </code>
      </p>
      <p>
       The event SQLSTATE value, as a string (for example,
       <code class="literal">
        '23000'
       </code>
       ).
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        subsystem
       </code>
      </p>
      <p>
       The subsystem in which the event occurred. Possible values
              are
       <code class="literal">
        InnoDB
       </code>
       (the
       <code class="literal">
        InnoDB
       </code>
       storage engine),
       <code class="literal">
        Repl
       </code>
       (the replication subsystem),
       <code class="literal">
        Server
       </code>
       (otherwise).
      </p>
     </li>
    </ul>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="error-log-event-optional-fields">
       </a>
       Optional Error Event Fields
      </h5>
     </div>
    </div>
   </div>
   <p>
    Optional error event fields fall into the following
          categories:
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       Additional information about the error, such as the error
              signaled by the operating system or the error label:
      </p>
      <div class="itemizedlist">
       <ul class="itemizedlist" style="list-style-type: circle; ">
        <li class="listitem">
         <p>
          <code class="literal">
           OS_errno
          </code>
         </p>
         <p>
          The operating system error number.
         </p>
        </li>
        <li class="listitem">
         <p>
          <code class="literal">
           OS_errmsg
          </code>
         </p>
         <p>
          The operating system error message.
         </p>
        </li>
        <li class="listitem">
         <p>
          <code class="literal">
           label
          </code>
         </p>
         <p>
          The label corresponding to the
          <code class="literal">
           prio
          </code>
          value, as a string.
         </p>
        </li>
       </ul>
      </div>
     </li>
     <li class="listitem">
      <p>
       Identification of the client for which the event occurred:
      </p>
      <div class="itemizedlist">
       <ul class="itemizedlist" style="list-style-type: circle; ">
        <li class="listitem">
         <p>
          <code class="literal">
           user
          </code>
         </p>
         <p>
          The client user.
         </p>
        </li>
        <li class="listitem">
         <p>
          <code class="literal">
           host
          </code>
         </p>
         <p>
          The client host.
         </p>
        </li>
        <li class="listitem">
         <p>
          <code class="literal">
           thread
          </code>
         </p>
         <p>
          The ID of the thread within
          <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
           <span class="command">
            <strong>
             mysqld
            </strong>
           </span>
          </a>
          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.
         </p>
        </li>
        <li class="listitem">
         <p>
          <code class="literal">
           query_id
          </code>
         </p>
         <p>
          The query ID.
         </p>
        </li>
       </ul>
      </div>
     </li>
     <li class="listitem">
      <p>
       Debugging information:
      </p>
      <div class="itemizedlist">
       <ul class="itemizedlist" style="list-style-type: circle; ">
        <li class="listitem">
         <p>
          <code class="literal">
           source_file
          </code>
         </p>
         <p>
          The source file in which the event occurred, without
                  any leading path.
         </p>
        </li>
        <li class="listitem">
         <p>
          <code class="literal">
           source_line
          </code>
         </p>
         <p>
          The line within the source file at which the event
                  occurred.
         </p>
        </li>
        <li class="listitem">
         <p>
          <code class="literal">
           function
          </code>
         </p>
         <p>
          The function in which the event occurred.
         </p>
        </li>
        <li class="listitem">
         <p>
          <code class="literal">
           component
          </code>
         </p>
         <p>
          The component or plugin in which the event occurred.
         </p>
        </li>
       </ul>
      </div>
     </li>
    </ul>
   </div>
  </div>
 </div>
 <br/>
</div>
