Split retrieving and logging the URL.

This is so that the log line never fails.