Devel query log not showing all queries I've enabled the Devel query log, and it's logging most queries as expected. However, I've got this module which connects to another database and executes a few queries against that one. All queries goes through db_select(), db_query(), db_insert(), db_delete() or db_update().

However, queries executed against the other database (connection is configured on the fly, and not through the settings.php file) never appears in the query log.

Any way I can make it work, so that ALL queries appear in query log at the bottom of the page?

Note: Caching does not seem to have anything to do with it. I've cleared all caches, returned to the page, and still no queries appear in the query log.
It's because Devel uses the Database::getLog() static method to get a list of the queries that have run for the page.

That method can only be run for a single connection at a time, and Devel specifically requests logs for the 'default' database connection (see devel_shutdown_real()):

$queries = (devel_query_enabled() ? Database::getLog('devel', 'default') : NULL);


In short you've got 2 options that I can think of:


Edit the devel module file directly, forcing it to loop through all available connections and combine the query logs (obviously hacking contrib modules is not recommended though)
Implement your own logic in a custom module and have a second set of query logs appear at the bottom of your page. The devel_shutdown() function and devel_shutdown_real() should give you all the code you need to get started if you go down this route.