Logging queries for DBI