Trying some patches for logging to be better compatible with gevent.