Download RDS Logs

Thank you for reading this post, don't forget to subscribe!

How we can check logs:

  1. Get all log files:

aws rds describe-db-log-files --db-instance-identifier wxyzpgprod --output text

where wxyzpgprod - is instance identifier.

  1. Download necessary log:

aws rds download-db-log-file-portion --db-instance-identifier wxyzpgprod --output text --starting-token 0 --log-file-name error/postgresql.log.2021-12-27-01 > logfile.txt
Also, there is a bash script that can be used: https://github.com/aws-samples/amazon-rds-and-amazon-aurora-logging-blog/blob/master/scripts/get\_pg\_log\_files.sh