HeatWave on AWS  /  ...  /  Server Error Logging

3.1.2.3 Server Error Logging

HeatWave on AWS logs MySQL Server diagnostic information such as errors, warnings, and status updates to the Performance Schema error_log table. You can use a command-line client such as MySQL Client or MySQL Shell to view this data. For information about connecting to the DB System from a client, see Connecting from a Client. If connecting from MySQL Shell, you must switch to SQL mode by typing \sql at the MySQL Shell prompt.

To view logs in the error_log table, run the following statement:

mysql> SELECT * FROM performance_schema.error_log;

You get a response similar to the following, which displays the event timestamp, the thread ID, the event priority, the event error code (if present), subsystem in which the event occurred, and text describing the event:

*************************** 1. row ***************************
    LOGGED: 2022-04-07 19:17:03.981201
 THREAD_ID: 0
      PRIO: Warning
ERROR_CODE: MY-011068
 SUBSYSTEM: Server
      DATA: The syntax 'skip_slave_start' is deprecated and will be removed 
            in a future release. Please use skip_replica_start instead.
*************************** 2. row ***************************
    LOGGED: 2022-04-07 19:17:03.98388
 THREAD_ID: 0
      PRIO: Note
ERROR_CODE: MY-010096
 SUBSYSTEM: Server
      DATA: Ignoring --secure-file-priv value as server is running with 
            --initialize(-insecure).
*************************** 3. row ***************************
    LOGGED: 2022-04-07 19:17:03.983921
 THREAD_ID: 0
      PRIO: Note
ERROR_CODE: MY-010949
 SUBSYSTEM: Server
      DATA: Basedir set to /usr/.
....

To filter the logs to show only errors, run this statement:

mysql> SELECT * FROM performance_schema.error_log 
          WHERE PRIO='error';

To filter the logs to only show errors from the RAPID, HeatWave, subsystem, run this statement:

mysql> SELECT * FROM performance_schema.error_log 
          WHERE SUBSYSTEM IN ('RAPID');

You can select from the following subsystems:

  • Server

  • InnoDB

  • RAPID

To filter on the RAPID (HeatWave) subsystem over a 2 hour time interval, run the following command:

mysql> SELECT * FROM performance_schema.error_log 
          WHERE SUBSYSTEM IN ('RAPID');

To retrieve a count of how many instances of a specific error occurred in a single day, run the following command:

mysql> SELECT HOUR(LOGGED), count(*) 
          FROM performance_schema.error_log 
          WHERE ERROR_CODE = 'MY-010914' 
          AND LOGGED > DATE_SUB(NOW(),INTERVAL 1 DAY) 
          GROUP BY HOUR(LOGGED);

To retrieve a count of how many instances of a specific error occurred in a week, run the following command:

mysql> SELECT DAY(LOGGED), count(*) 
          FROM performance_schema.error_log 
          WHERE ERROR_CODE = 'MY-010914' 
          AND LOGGED > DATE_SUB(NOW(),INTERVAL 1 WEEK) 
          GROUP BY DAY(LOGGED);