Add logging to Query
More logging