mod_debug_sql

This module enables extra verbose debug logging of all SQL queries done by Prosody, which is useful when debugging SQL-related problems.

modules_enabled = {
    -- other modules etc
    "debug_sql";
}
log = {
    debug = "/var/log/prosody/prosody.log"
}
storage = "sql"

Make sure to enable debug logging.