In write_socket(), also log the socket we're writing to.