Simple SQL statements debugging with MySQL global general_log variable turned ON
and a standalone php script that display the relevant SQL statements that are sent by a specific Moodle instance, filtered by the instance admin db username.
PHP Script: github/nadavkav/gist/nadavkav/mysql_statements_monitoring.php