added basic logging code, need to debug cloudant parts