- Documentation
RDS for PostgreSQL
User guide
Managing logs
Viewing and downloading logs
Managing logs
Viewing and downloading logs
Viewing and downloading logs
This topic describes how to view and download logs.
Background information
The RDS for PostgreSQL console displays switchover logs, slow logs, and error logs. Before using the slow log, you need to understand the following information.
Slow SQL refers to SQL queries whose execution time exceeds the set threshold. The slow log is the log file that records these slow queries. In RDS for PostgreSQL, the default SQL query execution time threshold is 1s, set by the log_min_duration_statement parameter. This parameter is a modifiable parameter provided by RDS for PostgreSQL and can be adjusted according to your business needs. For detailed information on modifying parameters, please refer to Modifying parameters. RDS for PostgreSQL also provides the modifiable parameter log_duration to control whether to print the execution time of each statement. This parameter can be set to on or off. When set to on, all user SQL statements are recorded as slow logs; when set to off, only SQL statements with execution time greater than log_min_duration_statement are recorded as slow logs. off is the default value.
To record only SQL statements with execution time greater than log_min_duration_statement in the logs, ensure log_duration is set to off and set the log_min_duration_statement parameter as needed.
Procedure
- In the upper-left corner of the top menu bar, select the project and region for the instance.
tip
If the project of the instance has not been set, the project should be selected as All resources.
- On the Instances page, click on the target instance name.
- View and download log information.
Slow log
Error log
Switchover log
- At the top of the page, click Database Workshop.
- click the Slow log sub-tab to view the log collection time, SQL statement, client IP, database, and execution time (s) of slow logs. Database Workbench provides more comprehensive slow log analysis functions. For details on usage, refer to Slow log analysis management.
- in the Slow SQL List area, click the right side of the page
> Export slow log to download slow log details locally.
Error logs can be viewed and downloaded from two entries: the Database Workshop tab and the Logs tab; choose either method.
- At the top of the page, click Database Workshop.
- On the Error log details sub-tab, view the Log collection time, Log level, and Log content of error logs. Common types of error logs can be found in List of common error logs.
- Click on the right side of the page
> Export log to download error log details locally.
- Click on the Logs tab on top of the page.
- On the Error log sub-tab, view the Log collection time, Log level, and Log content of error logs. Common types of error logs can be found in List of common error logs.
- Click on the right side of the page
, to download error log details locally.
- Click on the Logs tab on top of the page.
- The Switchover log sub-tab displays the New primary node, Old primary node, Switch type, and Switch time of primary/secondary switchover logs.
- Click on the right side of the page
, to download error log details locally.
Last updated: 2026.07.31 14:57:53