Log executed and prepared queries.