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.
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
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 navigation pane on the left, click Logs.
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.
NoteIf 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 |
Queries the slow query logs of an instance. | |
Queries the details about the slow query logs of an instance. | |
Queries the error logs of an instance. | |
Queries the WAL logs. | |
Queries the SQL audit logs of an instance. | |
Queries the SQL audit log files of an instance. |