Add logging to the reconnection code.