Add logging on socket errors