Add log for validIp.
Change logic of validIp method and remove wrong log message.