To enable slow query logging, add 'logslow' => 5 1
to the 'dboptions' array in config.php.
This will cause queries over 5 seconds 1 second (the 5 1 can be changed to any number of seconds) to be logged in the 'log_queries' table in the database. This table can also be export and sent to Totara Support.
...