Make SQL query logging configurable