https://issues.apache.org/bugzilla/show_bug.cgi?id=48244

           Summary: Socket Server configuration does not handle not
                    reverse DNS resolvable hosts
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Other
        AssignedTo: [email protected]
        ReportedBy: [email protected]


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?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to