psmith      2003/09/02 22:41:01

  Modified:    src/java/org/apache/log4j/chainsaw
                        ChainsawAppenderHandler.java
  Log:
  Small fix for LoggingEvents that only have the Remote
  host property, the identifier was made with the Socket
  #, but this is now removed as per previous versions.
  
  Revision  Changes    Path
  1.4       +9 -9      
jakarta-log4j/src/java/org/apache/log4j/chainsaw/ChainsawAppenderHandler.java
  
  Index: ChainsawAppenderHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-log4j/src/java/org/apache/log4j/chainsaw/ChainsawAppenderHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ChainsawAppenderHandler.java      3 Sep 2003 00:39:29 -0000       1.3
  +++ ChainsawAppenderHandler.java      3 Sep 2003 05:41:01 -0000       1.4
  @@ -254,15 +254,15 @@
              * Maybe there's a Remote Host entry?
              */
         String remoteHost = e.getProperty(ChainsawConstants.LOG4J_REMOTEHOST_KEY);
  -//        int rhlength = remoteHost.indexOf(":");
  -//
  -//        if (rhlength == -1) {
  -//          rhlength = properties.length();
  -//        }
  -//
  -//        remoteHost = properties.substring(rhposition, rhlength);
  -//      }
  -
  +      if(remoteHost!=null) {
  +            int colonIndex = remoteHost.indexOf(":");
  +    
  +            if (colonIndex == -1) {
  +              colonIndex = remoteHost.length();
  +            }
  +    
  +            remoteHost = remoteHost.substring(0, colonIndex);
  +      }    
         if (remoteHost != null) {
           ident.append(remoteHost);
         }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to