Added logging middleware.