This topic describes how to view the logs of an ApsaraDB RDS for MySQL instance by using the ApsaraDB RDS console. These logs include error logs, slow logs, and primary/secondary switchover logs. You can use these logs to troubleshoot issues on your RDS instance.

For more information about how to view the logs of an RDS instance that runs a different database engine, see the following topics:

Procedure

  1. Visit the RDS instance list, select a region above, and click the target instance ID.
  2. In the left-side navigation pane, click Logs.
  3. On the Logs page, click the Error Logs, Slow Log Details, Slow Log Summary, or Primary/Secondary Switching Logs tab, select a time range, and then click OK.
    Tab Log content
    Error Logs Provides statistics on the database running errors that occurred over the last month.
    Slow Log Details Provides statistics on the SQL statements that each took more than 1 second to run over the last month. Duplicate SQL statements are removed. You can change the 1-second threshold by reconfiguring the long_query_time parameter. For more information, see Reconfigure the parameters of an ApsaraDB RDS for MySQL instance.
    Note This tab is refreshed once every minute.
    Slow Log Summary Provides statistics and analysis reports on the SQL statements that each took more than 1 second to run over the last month. You can change the 1-second threshold by reconfiguring the long_query_time parameter. For more information, see Reconfigure the parameters of an ApsaraDB RDS for MySQL instance.
    Primary/Secondary Switching Logs Provides statistics on the primary/secondary switchovers that occurred over the last month. If your RDS instance runs the RDS Basic Edition, this tab cannot be found.
    Note If your RDS instance resides in the China (Zhangjiakou) region, ApsaraDB RDS retains only the error logs, slow log details, and slow log summary that are generated over the last nine days.