Adds more basic logging to query