Log an exception with a stack trace when a connection is disconnected.