--- apache-log4j-1.2.15.orig/src/main/java/org/apache/log4j/net/SocketServer.java 2007-08-25 00:09:40.000000000 -0400 +++ apache-log4j-1.2.15.orig/src/main/java/org/apache/log4j/net/SocketServer.java 2009-11-20 14:44:58.022583560 -0500 @@ -164,16 +164,15 @@ // yet. It will configure one and return it. LoggerRepository configureHierarchy(InetAddress inetAddress) { cat.info("Locating configuration file for "+inetAddress); - // We assume that the toSting method of InetAddress returns is in - // the format hostname/d1.d2.d3.d4 e.g. torino/192.168.1.1 - String s = inetAddress.toString(); - int i = s.indexOf("/"); - if(i == -1) { + String key = inetAddress.getHostName(); + if ( 0 == key.length() ) { + key = inetAddress.getHostAddress(); + } + if ( 0 == key.length() ) { cat.warn("Could not parse the inetAddress ["+inetAddress+ "]. Using default hierarchy."); return genericHierarchy(); } else { - String key = s.substring(0, i); File configFile = new File(dir, key+CONFIG_FILE_EXT); if(configFile.exists()) {