Add logging middleware.