This topic describes how to manage logs through the RDS console or by using SQL statements. You can query error logs and slow query logs. The log query results help you to locate faults.
You can query error logs, slow query logs, and primary/secondary instance switching logs of an instance through the console or by running SQL commands. These logs help you troubleshoot database issues. This topic describes how to manage logs through the console.
- For more information about the log backup settings, see Back up RDS for PostgreSQL data.
- For more information about how to download log backup files, see Download data and log backup files.
- For more information about how to recover from a log backup file, see Restore PostgreSQL data.
- PostgreSQL 10 Basic Edition does not support logs about switching between the primary database and secondary database.
- PostgreSQL 11 Cluster Edition (Standard SSD) and PostgreSQL 10 Cluster Edition (Standard SSD) do not support manage logs through the console. However, you can use SQL commands to query and manage logs.
- PostgreSQL 10 Cluster Edition (Local SSD)
- PostgreSQL 10 Basic Edition
- PostgreSQL 9.4
- Log on to the ApsaraDB for RDS console.
- In the upper-left corner of the page, select the region where the instance is located.
- Find the instance and click the instance ID.
- In the left-side navigation pane, click Logs.
- On the Logs page, select the Error Log, Slow Query Log or Primary/Secondary Instance Switching Log tab, select a time range, and click Update.
Log type Description Error log Records the logs of database errors within one month. Slow query log Records the logs of SQL statements whose execution period exceeds one second in the database within a month and removes the duplicates in the logs. Primary/secondary instance switching log Records the logs of switching between the primary and secondary databases within one month.Note Instances in China (Zhangjiakou-Beijing Winter Olympics) only retain the error logs and slow query logs within nine days.
|DescribeSlowLogs||You can call this operation to query the list of slow query logs.|
|DescribeSlowLogRecords||You can call this operation to query the details of slow query logs.|
|DescribeErrorLogs||You can call this operation to query error logs.|
|DescribeBinlogFiles||You can call this operation to query binlogs.|
|DescribeSQLLogRecords||You can call this operation to query audit logs.|
|DescribeSQLLogFiles||You can call this operation to query the list of audit log files.|