All Products
Search
Document Center

ApsaraDB RDS:View logs

Last Updated:Nov 21, 2025

This topic describes how to manage error logs and slow query logs of an ApsaraDB RDS for PostgreSQL instance in the ApsaraDB RDS console or using SQL statements.

Note

Logs in this topic refer to error logs and slow query logs. For more information about archived logs, see Back up an ApsaraDB RDS for PostgreSQL instance and Download backup files.

Usage notes

None.

View logs

  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 navigation pane on the left, click Logs.

  3. On the Logs page, select error logs or slow query log details, and select a time range. The system automatically displays the details within the specified time period.

    Query item

    Description

    Error Logs

    Records the database running errors that occurred over the most recent 30 days.

    Slow Log Details

    Records the SQL statements that took longer than 1 second to execute over the most recent seven days. Duplicate SQL statements are removed.

    Note
    • If the RDS instance resides in the China (Zhangjiakou) region, only the error logs and slow query logs generated over the most recent nine 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, you can modify the instance parameter rds_max_log_files. A larger number of retained CSV log files indicates a longer time required to complete a query and more storage space occupied.

Related 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 logs.

DescribeSQLLogRecords

Queries the SQL audit logs of an instance.

DescribeSQLLogFiles

Queries the SQL audit log files of an instance.