Add some logging to `connect` and `listen`.