1. logout on write error; 2. includes host:port on login/out