logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From psm...@apache.org
Subject cvs commit: jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw ChainsawConstants.java LogUI.java
Date Thu, 08 May 2003 00:02:07 GMT
psmith      2003/05/07 17:02:07

  Modified:    src/java/org/apache/log4j/chainsaw ChainsawConstants.java
                        LogUI.java
  Log:
  added ability to use the RemoteHost property if it is there for the tab 
  pane, if it can't find anything else to use.
  
  Revision  Changes    Path
  1.4       +1 -0      jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/ChainsawConstants.java
  
  Index: ChainsawConstants.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/ChainsawConstants.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ChainsawConstants.java	5 May 2003 00:59:05 -0000	1.3
  +++ ChainsawConstants.java	8 May 2003 00:02:06 -0000	1.4
  @@ -37,6 +37,7 @@
     static final String NONE_COL_NAME = "None";
     static final String LOG4J_APP_KEY = "log4japp";
     static final String LOG4J_MACHINE_KEY = "log4jmachinename";
  +  static final String LOG4J_REMOTEHOST_KEY = "log4j.remoteSourceInfo";
     static final String LOG4J_ID_KEY = "log4jid";
     static final String UNKNOWN_TAB_NAME = "Unknown";
     static final String GLOBAL_MATCH = "*";
  
  
  
  1.36      +20 -1     jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/LogUI.java
  
  Index: LogUI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/LogUI.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- LogUI.java	7 May 2003 17:10:28 -0000	1.35
  +++ LogUI.java	8 May 2003 00:02:07 -0000	1.36
  @@ -266,7 +266,6 @@
             System.exit(0);
           }
         });
  -
       setVisible(true);
     }
   
  @@ -373,6 +372,26 @@
       if (appname != null) {
         ident.append("-");
         ident.append(appname);
  +    }
  +    
  +    if( ident.length() == 0) {
  +    	/**
  +    	 * Maybe there's a Remote Host entry?
  +    	 */
  +			String remoteHostKey = ChainsawConstants.LOG4J_REMOTEHOST_KEY + "=";
  +			String remoteHost = null;
  +			int rhposition = properties.indexOf(remoteHostKey) + remoteHostKey.length();
  +
  +			if (rhposition >= remoteHostKey.length()) {
  +				int rhlength = properties.indexOf(",", rhposition);
  +
  +				if (rhlength == -1) {
  +					rhlength = properties.length();
  +				}
  +
  +				remoteHost = properties.substring(rhposition, rhlength);
  +			}
  +			ident.append(remoteHost);
       }
   
       if (ident.length() == 0) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org


Mime
View raw message