Some basic support for logging query and commands