All Products
Search
Document Center

ApsaraDB RDS:View logs

Last Updated:Mar 01, 2026

You can view error logs and slow query logs for an ApsaraDB RDS for PostgreSQL instance through the ApsaraDB RDS console or by using SQL statements. These logs help you identify database issues and optimize query performance.

Note

This topic covers error logs and slow query logs only. For information about archived logs, see Back up an ApsaraDB RDS for PostgreSQL instance and Download backup files.

Log types

The following table describes the log types available on the Logs page.

Log typeDescriptionRetention period
Error LogsRecords database running errors.Most recent 30 days
Slow Log DetailsRecords SQL statements that took longer than 1 second to execute. Duplicate SQL statements are removed.Most recent 7 days
Note
  • If the RDS instance resides in the China (Zhangjiakou) region, only the error logs and slow query logs generated over the most recent 9 days are retained.

  • ApsaraDB RDS collects CSV log file content from databases and saves it to a log server for you to view. To adjust the maximum number of CSV log files retained in the database, modify the instance parameter rds_max_log_files. A larger number of retained CSV log files increases the time required to complete a query and the storage space consumed.

View logs in the console

  1. 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.

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

  3. On the Logs page, select Error Logs or Slow Log Details, and then select a time range. The system displays the log details for the specified time period.

Related API operations

You can also manage logs programmatically through the following API operations.

API operation

Description

DescribeSlowLogs

Queries the slow query logs of an instance.

DescribeSlowLogRecords

Queries the details about the slow query logs of an instance.

DescribeErrorLogs

Queries the error logs of an instance.

DescribeBinlogFiles

Queries the WAL (write-ahead log) files of an instance.

DescribeSQLLogRecords

Queries the SQL audit logs of an instance.

DescribeSQLLogFiles

Queries the SQL audit log files of an instance.