Added log of queries.