Fix logging for URLs with query string