Use Query.getQuery in logging plugin.