How to look at slow query logs for aurora serverless

Viewed 1554

I have created aws aurora mysql with serverless option. For parameter group I have set

slow_query_log = 1
slow_query_log_file = /rdsdbdata/log/slowquery/mysql-slowquery.log
log_output = TABLE

When I connect to the instance and run show global variables like '%log_out%'; it show the setting for log_out = FILE Also I do not see any option like in instance type where I can set the log to show up in cloudwatch.

So How can I look at the slow query log for AWS Aurora Serverless

1 Answers

In your AWS parameter group, make log_output = FILE rather than TABLE. This is a dynamic parameter and should cause your slow_query_log_file to include information for queries that take longer than 'long_query_time' seconds to complete execution. Use SELECT @@long_query_time to determine current setting. long_query_time of 1 would probably be more useful than 10 (seconds).

Related