A simple query logging utility.