Read the server log
Search the PostgreSQL server log of every node for errors, slow statements and failed logins.
The log shows every node's PostgreSQL server log, newest first: errors with their statement, slow statements, failed logins, a new leader's promotion and recovery after a crash. Lines are kept seven days. Replace ewdb-0123456789ab with your database's id.
Prerequisites
- Permission for
rds:DescribeDBLogFiles. The log carries statement text with its values, so reading it needs its own permission, and each read is recorded in the audit log. Without it the Logs tab is locked and names the action. - Machines built with log shipping. Machines built before it keep their log on the machine, and the tab shows no lines.
- In the console, also
rds:DescribeDBInstancesto open the database's page (without it the page is not found).
Read the log
- Open the database, then choose the Logs tab. It shows the last day, up to 500 lines.
- (Optional) In the search box, enter text and press Enter.
- (Optional) Choose a severity: All, Errors, Warnings or Log.
With nothing found, the tab says "No lines in the last day".
dcloud rds instances logs ewdb-0123456789ab --severity error --contains deadlock --limit 200--node limits it to one node (its ordinal, 1 for the first); --start and --end set the range
(the last day by default). --limit defaults to 200 lines, at most 1000.
GET /rds/api/instances/ewdb-0123456789ab/logs?severity=error&contains=deadlock&limit=200Not available in Terraform. The log is read, not configured.
Result
Statements slower than log_min_duration_statement (1 s by default; set it under Parameters,
-1 turns it off) are logged with their duration. The platform's own statements are logged under
its role, ews_platform, once the platform has created that role on the database. When a node writes its log faster than it can be shipped, the skipped
lines are noted on Activity (phase logs).