tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http10 HttpConnector.java
Date Tue, 11 Sep 2001 17:33:02 GMT
craigmcc    01/09/11 10:33:02

  Modified:    catalina/src/share/org/apache/catalina/connector/http
                        HttpConnector.java
               catalina/src/share/org/apache/catalina/connector/http10
                        HttpConnector.java
  Log:
  Tweak the log messages printed during connector startup to avoid printing
  "null" because the thread name has not been initialized yet (which can
  incorrectly imply that something is wrong).
  
  PR: Bugzilla #3547
  Submitted by:	Martijn Koster <mail-apache-bugzilla@greenhills.co.uk>
  
  Revision  Changes    Path
  1.24      +14 -8     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java
  
  Index: HttpConnector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- HttpConnector.java	2001/08/29 01:44:07	1.23
  +++ HttpConnector.java	2001/09/11 17:33:02	1.24
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
1.23 2001/08/29 01:44:07 remm Exp $
  - * $Revision: 1.23 $
  - * $Date: 2001/08/29 01:44:07 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpConnector.java,v
1.24 2001/09/11 17:33:02 craigmcc Exp $
  + * $Revision: 1.24 $
  + * $Date: 2001/09/11 17:33:02 $
    *
    * ====================================================================
    *
  @@ -96,7 +96,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.23 $ $Date: 2001/08/29 01:44:07 $
  + * @version $Revision: 1.24 $ $Date: 2001/09/11 17:33:02 $
    */
   
   
  @@ -872,10 +872,13 @@
       private void log(String message) {
   
           Logger logger = container.getLogger();
  +        String localName = threadName;
  +        if (localName == null)
  +            localName = "HttpConnector";
           if (logger != null)
  -            logger.log(threadName + " " + message);
  +            logger.log(localName + " " + message);
           else
  -            System.out.println(threadName + " " + message);
  +            System.out.println(localName + " " + message);
   
       }
   
  @@ -889,10 +892,13 @@
       private void log(String message, Throwable throwable) {
   
           Logger logger = container.getLogger();
  +        String localName = threadName;
  +        if (localName == null)
  +            localName = "HttpConnector";
           if (logger != null)
  -            logger.log(threadName + " " + message, throwable);
  +            logger.log(localName + " " + message, throwable);
           else {
  -            System.out.println(threadName + " " + message);
  +            System.out.println(localName + " " + message);
               throwable.printStackTrace(System.out);
           }
   
  
  
  
  1.12      +14 -8     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http10/HttpConnector.java
  
  Index: HttpConnector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http10/HttpConnector.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- HttpConnector.java	2001/08/23 22:32:10	1.11
  +++ HttpConnector.java	2001/09/11 17:33:02	1.12
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http10/HttpConnector.java,v
1.11 2001/08/23 22:32:10 craigmcc Exp $
  - * $Revision: 1.11 $
  - * $Date: 2001/08/23 22:32:10 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http10/HttpConnector.java,v
1.12 2001/09/11 17:33:02 craigmcc Exp $
  + * $Revision: 1.12 $
  + * $Date: 2001/09/11 17:33:02 $
    *
    * ====================================================================
    *
  @@ -95,7 +95,7 @@
    * purposes.  Not intended to be the final solution.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.11 $ $Date: 2001/08/23 22:32:10 $
  + * @version $Revision: 1.12 $ $Date: 2001/09/11 17:33:02 $
    */
   
   
  @@ -799,10 +799,13 @@
       private void log(String message) {
   
           Logger logger = container.getLogger();
  +        String localName = threadName;
  +        if (localName == null)
  +            localName = "HttpConnector";
           if (logger != null)
  -            logger.log(threadName + " " + message);
  +            logger.log(localName + " " + message);
           else
  -            System.out.println(threadName + " " + message);
  +            System.out.println(localName + " " + message);
   
       }
   
  @@ -816,10 +819,13 @@
       private void log(String message, Throwable throwable) {
   
           Logger logger = container.getLogger();
  +        String localName = threadName;
  +        if (localName == null)
  +            localName = "HttpConnector";
           if (logger != null)
  -            logger.log(threadName + " " + message, throwable);
  +            logger.log(localName + " " + message, throwable);
           else {
  -            System.out.println(threadName + " " + message);
  +            System.out.println(localName + " " + message);
               throwable.printStackTrace(System.out);
           }
   
  
  
  

Mime
View raw message