Add query in the log