Log query and report improve