Overview of MySQL database logs - Amazon Relational Database Service

Overview of MySQL database logs

You can monitor the following types of MySQL log files:

  • Error log

  • Slow query log

  • General log

The MySQL error log is generated by default. You can generate the slow query and general logs by setting parameters in your DB parameter group.

Log rotation and retention

The MySQL slow query log, error log, and the general log file sizes are constrained to no more than 2 percent of the allocated storage space for a DB instance. To maintain this threshold, logs are automatically rotated every hour. MySQL removes log files more than two weeks old. If the combined log file size exceeds the threshold after removing old log files, then the oldest log files are deleted until the log file size no longer exceeds the threshold.

Size limits on BLOBs

For MySQL, there is a size limit on BLOBs written to the redo log. To account for this limit, ensure that the innodb_log_file_size parameter for your MySQL DB instance is 10 times larger than the largest BLOB data size found in your tables, plus the length of other variable length fields (VARCHAR, VARBINARY, TEXT) in the same tables. For information on how to set parameter values, see Working with DB parameter groups. For information on the redo log BLOB size limit, go to Changes in MySQL 5.6.20.