Add more logging, logging config and a patch for the wrapped socketerror