2009-11-19 16:22:06,955 () SocketServer [INFO] - Listening on port 514 2009-11-19 16:22:06,960 () SocketServer [INFO] - Waiting to accept a new client. 2009-11-19 16:22:37,632 () SocketServer [INFO] - Connected to client at /10.16.1.16 2009-11-19 16:22:37,632 () SocketServer [INFO] - Locating configuration file for /10.16.1.16 2009-11-19 16:22:37,633 () SocketServer [WARN] - Could not find config file [/opt/log4j-server/etc/servers/.lcf]. It seems like this code needs to realize when it gets a blank response back for the hostname and maybe use the IP in the config filename instead. --snip-- 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) { cat.warn("Could not parse the inetAddress ["+inetAddress+ "]. Using default hierarchy."); return genericHierarchy(); } else { String key = s.substring(0, i); ----- Also, is it more correct to use InetAddress.getHostname and getHostAddress instead of parsing the .toString output?
Created attachment 24574 [details] Proposed patch, fails back to IP in config file name if hostname not available.
Created attachment 24575 [details] Previous patch had some garbage diff info in it