This topic describes how to manage error logs, slow query logs, and primary/secondary instance switching logs of an ApsaraDB for RDS MySQL instance through the ApsaraDB for RDS console. The logs help you locate faults.

Note All RDS editions except the Basic Edition support the log management function. For more information about binary logs, see Back up an ApsaraDB RDS MySQL instance and Download the data backup files and log backup files of an RDS for MySQL instance.

Procedure

  1. Log on to the ApsaraDB for RDS console.
  2. In the upper-left corner of the console, select the region where the target RDS instance resides.Select a region
  3. Find the target RDS instance and click its ID.
  4. In the left-side navigation pane, click Logs.
  5. On the Logs page that appears, click the Error Log, Slow Query Log, Slow Query Log Summary, or Primary/Secondary Instance Switching Log tab, select a time range, and click Search.
    Tab Description
    Error Log Records database running errors that occurred within the last month.
    Slow Query Log Provides SQL statements that each took more than 1 second to run within the last month. Duplicate SQL statements are deleted. You can change this 1-second threshold by reconfiguring the long_query_time parameter. For more information, see Reconfigure parameters for an RDS MySQL instance.
    Note Slow query logs in the ApsaraDB for RDS console are updated once every minute. Optionally, you can query real-time slow query logs from the mysql.slow_log table.
    Slow Query Log Summary Provides statistics and analysis reports on SQL statements that each took more than 1 second to run within the last month. You can change this 1-second threshold by reconfiguring the long_query_time parameter. For more information, see Reconfigure parameters for an RDS MySQL instance.
    Primary/Secondary Instance Switching Log Records switchovers between the primary and secondary instances triggered within the last month. This tab appears only if your RDS MySQL instance is not in the Basic Edition.
    Note If your ApsaraDB for RDS MySQL instance resides in the China (Zhangjiakou-Beijing Winter Olympics) region, the system retains only error logs, slow query logs, and slow query log summary generated within the last nine days.