All Products
Search
Document Center

ApsaraDB RDS:View error logs and slow query logs

Last Updated:Sep 02, 2026

Use the ApsaraDB RDS console to view error logs and slow query logs for an ApsaraDB RDS for MySQL instance. These logs help you identify and troubleshoot database issues such as runtime errors and slow-performing SQL statements.

Note

This topic covers error logs and slow query logs only. For binary logs, see Configure automatic backup and Download backup. For logs on other database engines, see the topics for ApsaraDB RDS for SQL Server, ApsaraDB RDS for PostgreSQL, and ApsaraDB RDS for MariaDB.

Log types

The Logs page in the ApsaraDB RDS console provides the following tabs:

Tab What it shows Retention
Error Logs Database runtime errors over the most recent 30 days. 30 days (9 days in China (Zhangjiakou))
Slow Log Details Individual SQL statements that exceeded the long_query_time threshold (default: 1 second), deduplicated, over the most recent 7 days. Refreshed every minute. 7 days
Slow Log Summary Aggregated summary of slow SQL statements over the most recent 7 days. Exportable as a report. Updated with a 6–8 hour delay. 7 days
Binlog Subscription Subscribe to binary logs via Data Transmission Service (DTS). —
Note

Error logs do not include deadlock logs. To view deadlock logs, go to Autonomy Services > Diagnostics on the instance details page and click the Lock Analysis tab to view deadlock logs.

Before you begin

  • Slow query threshold: Both Slow Log Details and Slow Log Summary capture SQL statements that exceed the long_query_time threshold, which defaults to 1 second. To change the threshold, modify the long_query_time parameter. For details, see Modify instance parameters.

  • Slow Log Summary delay: Data in the Slow Log Summary tab is not real-time. Expect a delay of 6–8 hours before new data appears.

  • China (Zhangjiakou) region: Error logs are retained for 9 days; slow query logs are retained for 7 days.

View logs

  1. Log on to the ApsaraDB RDS console. On the Instances page, select the region where your instance resides, then click the instance ID.

  2. In the left-side navigation pane, click Logs.

  3. Click the Error Logs, Slow Log Details, or Slow Log Summary tab, select a time range, and click OK.

FAQ

How do I clear the error logs of a MySQL instance to free up disk space?

The Error Logs tab supports viewing error logs only. You cannot clear error logs directly from the console. To free up disk space, call the PurgeDBInstanceLog API to purge the binary logs of the instance. Clearing error logs does not affect the data in your database. If error logs are consuming an excessive amount of disk space, investigate the root cause of the abnormal log generation.

What's next