Work on logging
Add reconnection and logging