query log method