Bug fix: init the Logger earlier.

Following the Middleware refectoring, the Logger init was moved in the log middleware,
causing the user error logging to fail with an "empty response from server"