/** * 取本机的ip * * @return */ private String getHost() { String ip = ""; try { InetAddress addr = InetAddress.getLocalHost(); ip = addr.getHostAddress().toString(); } catch (Exception e) { ip = e.getMessage(); LogUtil.getAppLog().error("get Ip error:", e); } return ip; }