This topic describes how to view the error logs and slow query logs of an ApsaraDB RDS for MySQL instance in the ApsaraDB RDS console. You can use the logs to troubleshoot issues on the RDS instance.
Logs in this topic refer to error logs and slow query logs. For more information about binary logs, see Configure automatic backup and Download backup files.
Error logs do not include deadlock logs. To query deadlock logs, you can perform the following operations: In the left-side navigation bar of the details page of your RDS instance, choose Autonomy Services > Diagnostics. On the page that appears, click the Lock Analysis tab. For more information, see Use the deadlock analysis feature.
For more information about how to view the logs of an RDS instance that runs a different database engine, see the following topics:
Procedure
Log on to the ApsaraDB RDS console and go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the instance ID.
In the left-side navigation pane, click Logs.
On the Logs page, click the Error Logs, Slow Log Details, or Slow Log Summary tab, select a time range, and click OK. The following table describes the tabs that are displayed on the Logs page.
Tab
Description
Binlog Subscription
Allows you to subscribe to binary logs by using Data Transmission Service (DTS). For more information, see Track data changes from an ApsaraDB RDS for MySQL instance.
Error Logs
Provides statistics about the database running errors that occurred over the most recent 30 days.
Slow Log Details
Provides details about the SQL statements that each took more than 1 second to execute over the most recent 7 days and removes duplicate SQL statements. You can modify the long_query_time parameter to change the threshold. For more information, see Modify instance parameters.
NoteThis tab is refreshed once every minute.
Slow Log Summary
Provides a summary of the SQL statements that each took more than 1 second to execute over the most recent 7 days and allows you to export the summary as a report file. You can modify the long_query_time parameter to change the threshold. For more information, see Modify instance parameters.
NoteSlow query logs are not collected in real time and may show a latency of 6 hours to 8 hours.
NoteIf an RDS instance resides in the China (Zhangjiakou) region, ApsaraDB RDS retains only the error logs that are generated over the most recent nine days and the details and summary of the slow query logs that are generated over the most recent seven days for the RDS instance.