For applications with many queries or a large amount of data and related queries going through, it can be useful to switch on query logging on a selective basis to gain diagnostic information, but not increase the log volume too much.
This could be done by
1) Allowing a logging category string to be associated with each query.
2) Allowing logging level (DEBUG/INFO/WARN/..) to be configured for each separate category.
Ideally it should be possible to change the logging levels for the logging categories without restarting the application.