少し古い情報ですが、以前RDSのログファイルがコンソールで閲覧できたり、ダウンロードできるようになりしました。
- Amazon RDS – より簡単にログファイルにアクセス可能に
- Working with Database Log Files
詳細は下記に詳しく記載されいています。
実際にコンソールを確認してみると下記のようにログを確認することができます。
実際のログは次の通りです。
そして、このログをPython版AWSコマンドラインツールでダウンロードしてみました。
実際のコマンドと結果は次の通りです。
# aws rds download-db-log-file-portion
> --db-instance-identifier master
> --log-file-name error/mysql-error-running.log.7
> | jq '.LogFileData'
> | sed 's/^"//'
> | sed 's/"$//'
> | sed 's/\n/n/g'
130501 6:50:41 [Note] Plugin 'FEDERATED' is disabled.
130501 6:50:41 InnoDB: The InnoDB memory heap is disabled
130501 6:50:41 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130501 6:50:41 InnoDB: Compressed tables use zlib 1.2.3
130501 6:50:41 InnoDB: Using Linux native AIO
130501 6:50:41 InnoDB: Initializing buffer pool, size = 311.0M
130501 6:50:41 InnoDB: Completed initialization of buffer pool
130501 6:50:41 InnoDB: Log file /rdsdbdata/log/innodb/ib_logfile0 did not exist: new to be created
InnoDB: Setting log file /rdsdbdata/log/innodb/ib_logfile0 size to 128 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Progress in MB: 100
130501 6:50:46 InnoDB: Log file /rdsdbdata/log/innodb/ib_logfile1 did not exist: new to be created
InnoDB: Setting log file /rdsdbdata/log/innodb/ib_logfile1 size to 128 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Progress in MB: 100
130501 6:50:52 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
130501 6:50:52 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
130501 6:50:52 InnoDB: Waiting for the background threads to start
130501 6:50:53 InnoDB: 1.1.8 started; log sequence number 1606156
130501 6:50:53 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130501 6:50:53 [Note] - '0.0.0.0' resolves to '0.0.0.0';
130501 6:50:53 [Note] Server socket created on IP: '0.0.0.0'.
130501 6:50:53 [Note] Event Scheduler: Loaded 0 events
130501 6:50:53 [Note] /rdsdbbin/mysql/bin/mysqld: ready for connections.
Version: '5.5.27-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution