Add query log