Adding logging for query times.