Modified logging, fix gevent threading error