You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ca...@apache.org on 2006/09/05 07:23:41 UTC
svn commit: r440265 -
/logging/log4j/trunk/src/java/org/apache/log4j/net/SocketServer.java
Author: carnold
Date: Mon Sep 4 22:23:41 2006
New Revision: 440265
URL: http://svn.apache.org/viewvc?view=rev&rev=440265
Log:
Bug 40412: Reverting inadvertant change to SocketServer.java
Modified:
logging/log4j/trunk/src/java/org/apache/log4j/net/SocketServer.java
Modified: logging/log4j/trunk/src/java/org/apache/log4j/net/SocketServer.java
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/src/java/org/apache/log4j/net/SocketServer.java?view=diff&rev=440265&r1=440264&r2=440265
==============================================================================
--- logging/log4j/trunk/src/java/org/apache/log4j/net/SocketServer.java (original)
+++ logging/log4j/trunk/src/java/org/apache/log4j/net/SocketServer.java Mon Sep 4 22:23:41 2006
@@ -164,7 +164,19 @@
LoggerRepository configureHierarchy(InetAddress inetAddress) {
logger.info("Locating configuration file for " + inetAddress);
- String key = inetAddress.getHostName();
+ // 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) {
+ logger.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);
@@ -181,6 +193,7 @@
return genericHierarchy();
}
+ }
}
LoggerRepository genericHierarchy() {
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org