Fix buffer length issue, set up curl timeouts
Write config to log file in case couch is down.