Lines 164-179
Link Here
|
164 |
// yet. It will configure one and return it. |
164 |
// yet. It will configure one and return it. |
165 |
LoggerRepository configureHierarchy(InetAddress inetAddress) { |
165 |
LoggerRepository configureHierarchy(InetAddress inetAddress) { |
166 |
cat.info("Locating configuration file for "+inetAddress); |
166 |
cat.info("Locating configuration file for "+inetAddress); |
167 |
// We assume that the toSting method of InetAddress returns is in |
167 |
String key = inetAddress.getHostName(); |
168 |
// the format hostname/d1.d2.d3.d4 e.g. torino/192.168.1.1 |
168 |
if ( 0 == key.length() ) { |
169 |
String s = inetAddress.toString(); |
169 |
key = inetAddress.getHostAddress(); |
170 |
int i = s.indexOf("/"); |
170 |
} |
171 |
if(i == -1) { |
171 |
if ( 0 == key.length() ) { |
172 |
cat.warn("Could not parse the inetAddress ["+inetAddress+ |
172 |
cat.warn("Could not parse the inetAddress ["+inetAddress+ |
173 |
"]. Using default hierarchy."); |
173 |
"]. Using default hierarchy."); |
174 |
return genericHierarchy(); |
174 |
return genericHierarchy(); |
175 |
} else { |
175 |
} else { |
176 |
String key = s.substring(0, i); |
|
|
177 |
|
176 |
|
178 |
File configFile = new File(dir, key+CONFIG_FILE_EXT); |
177 |
File configFile = new File(dir, key+CONFIG_FILE_EXT); |
179 |
if(configFile.exists()) { |
178 |
if(configFile.exists()) { |