Moved logger to the top of the middleware stack