Query error logs and slow query logs in the console or use SQL to troubleshoot issues.
This topic covers error logs and slow query logs. Archived logs are covered in Back up ApsaraDB RDS for PostgreSQL data and Download a backup file.
Usage notes
-
Slow query log integrity: Under extreme conditions, slow query log records may be incomplete or lost:
-
The instance experiences performance bottlenecks.
-
The instance receives a high volume of SQL requests.
-
The slow query log collection component malfunctions.
-
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 left-side navigation pane, click Logs.
-
On the Logs page, select Logs or Logs, and then specify a time range to view the log details.
Type
Description
Error log
Records database errors from the last month.
Slow query log details
Records SQL statements from the last 7 days that took more than 1 second to execute. Similar statements are deduplicated.
Note-
For instances in the China (Zhangjiakou) region, only the error logs and slow query log details from the last 9 days are retained.
-
The system collects csvlog file content and stores it on a log server. Modify the rds_max_log_files parameter to adjust the maximum number of retained csvlog files. More csvlog files extend the queryable time range but consume more storage.
-
API reference
|
API |
Description |
|
Queries slow query logs. |
|
|
Queries slow query log details. |
|
|
Queries error logs for an instance. |
|
|
Queries the write-ahead log (WAL) files for an instance. |
|
|
Queries SQL audit logs for an instance. |
|
|
Queries the SQL audit log files for an instance. |