Problem
Amazon RDS can output slow query log to Cloud Watch.
The cause is unclear but this log is sometimes stop. You can check log is working correctly by SQL below.
select sleep(5);
*The argument value of the sleep function (5 in above example) should same or greater than long_query_time
value in the parameter group of Amazon RDS.
You can see output log on the Cloud Watch when log is working correctly. If you cannot see it, log is stopped.
Solution
Edit
slow_query_log
value of parameter group to0
.
*The database is not restart by this change because this parameter is dynamic type.Wait for database status become
Modifying
then back toAvailable
.Edit
slow_query_log
value of parameter group to1
.Wait for database status become
Modifying
then back toAvailable
again.Execute SQL
select sleep(5);
then check slow query log is output on the Cloud Watch.