记录登录日志时可获取正常的ipv4地址,而非0.0.0.0.0.1 InetAddress addr =InetAddress.getLocalHost(); String Ip=addr.getHostAddress();