Menu
Amazon Relational Database Service
User Guide (API Version 2014-10-31)

Amazon RDS Database Log Files

You can view, download, and watch database logs using the Amazon RDS console, the AWS Command Line Interface (AWS CLI), or the Amazon RDS API. Viewing, downloading, or watching transaction logs is not supported.

For engine-specific documentation, see the following:

Database Engine Relevant Documentation

MariaDB

You can access the error log, the slow query log, and the general log. For more information, see MariaDB Database Log Files.

Microsoft SQL Server

You can access SQL Server error logs, agent logs, and trace files. For more information, see Microsoft SQL Server Database Log Files.

MySQL

You can access the error log, the slow query log, and the general log. For more information, see MySQL Database Log Files.

Oracle

You can access Oracle alert logs, audit files, and trace files. For more information, see Oracle Database Log Files.

PostgreSQL

You can access query logs and error logs. Error logs can contain auto-vacuum and connection information, as well as rds_admin actions. For more information, see PostgreSQL Database Log Files.

Viewing and Listing Database Log Files

You can view database log files for your DB engine by using the Amazon RDS console. You can list what log files are available for download or monitoring by using the Amazon RDS CLI or APIs.

Note

If you cannot view the list of log files for an existing Oracle DB instance, reboot the instance to view the list.

AWS Management Console

To view a database log file

  1. Open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the navigation pane, choose Instances.

  3. Choose the DB instance that has the log file you want to view, and then choose Instance Actions | See Details.

  4. Choose the Recent Events & Logs tab.

  5. In the Logs pane, choose the View button next to the log you want to view.

CLI

To list the available database log files for a DB instance use the AWS CLI describe-db-log-files command.

The following example directs a list of log files for a DB instance named my-db-instance to a text file called log_file_list.txt.

Example

Copy
aws rds describe-db-log-files --db-instance-identifier my-db-instance > log_file_list.txt

API

To list the available database log files for a DB instance call the Amazon RDS API DescribeDBLogFiles action.

Downloading a Database Log File

You can use the Amazon RDS console or the AWS CLI to download a database log file.

You can download a complete log file by using the DownloadCompleteDBLogFile REST API. You can also download complete log files by using the rds-download-db-logfile RDS CLI command. For more information, see The rds-download-db-logfile Command .

AWS Management Console

To download a database log file

  1. Open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the navigation pane, choose Instances.

  3. Choose the DB instance that has the log file you want to view, and then choose Instance Actions | See Details.

  4. Choose the Recent Events & Logs tab.

  5. In the Logs pane, choose the Download button next to the log you want to download.

  6. Right-click the link provided, and then choose Save Link As... from the dropdown menu. Type the location where you want the log file to be saved, then choose Save.

    
								viewing log file

CLI

To download a database log file use the command download-db-log-file-portion.

The following example shows how to download the contents of a log file called log/ERROR.4 and store it in a local file called errorlog.txt.

Example

For Linux, OS X, or Unix:

Copy
aws rds download-db-log-file-portion \ --db-instance-identifier myexampledb \ --no-paginate \ --log-file-name log/ERROR.4 > errorlog.txt

For Windows:

Copy
aws rds download-db-log-file-portion ^ --db-instance-identifier myexampledb ^ --no-paginate ^ --log-file-name log/ERROR.4 > errorlog.txt

Watching a Database Log File

You can monitor the contents of a log file by using the Amazon RDS console.

AWS Management Console

To watch a database log file

  1. Open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the navigation pane, choose Instances.

  3. Choose the DB instance that has the log file you want to watch, and then choose Instance Actions | See Details.

  4. Choose the Recent Events & Logs tab.

  5. In the Logs pane, choose the Watch button next to the log you want to watch.

Related Topics