tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@locus.apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/logger LoggerBase.java
Date Mon, 11 Sep 2000 18:53:57 GMT
craigmcc    00/09/11 11:53:55

  Modified:    catalina/src/share/org/apache/catalina/logger
                        LoggerBase.java
  Log:
  Make all loggers that subclass LoggerBase smarter about dumping out the root
  cause of LifecycleExceptions as well as ServletExceptions.
  
  Revision  Changes    Path
  1.2       +13 -12    jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/logger/LoggerBase.java
  
  Index: LoggerBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/logger/LoggerBase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LoggerBase.java	2000/08/11 22:44:22	1.1
  +++ LoggerBase.java	2000/09/11 18:53:53	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/logger/LoggerBase.java,v
1.1 2000/08/11 22:44:22 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2000/08/11 22:44:22 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/logger/LoggerBase.java,v
1.2 2000/09/11 18:53:53 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2000/09/11 18:53:53 $
    *
    * ====================================================================
    *
  @@ -71,6 +71,7 @@
   import java.io.PrintWriter;
   import javax.servlet.ServletException;
   import org.apache.catalina.Container;
  +import org.apache.catalina.LifecycleException;
   import org.apache.catalina.Logger;
   
   
  @@ -80,7 +81,7 @@
    * any property setting and lifecycle methods required for configuration.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2000/08/11 22:44:22 $
  + * @version $Revision: 1.2 $ $Date: 2000/09/11 18:53:53 $
    */
   
   abstract class LoggerBase
  @@ -260,15 +261,15 @@
   	PrintWriter writer = new PrintWriter(buf);
   	writer.println(msg);
   	throwable.printStackTrace(writer);
  -	if (throwable instanceof ServletException) {
  -	    Throwable rootCause =
  -		((ServletException) throwable).getRootCause();
  -	    if (rootCause != null) {
  -		writer.println("----- Root Cause -----");
  -		rootCause.printStackTrace(writer);
  -	    }
  +        Throwable rootCause = null;
  +        if (throwable instanceof LifecycleException)
  +            rootCause = ((LifecycleException) throwable).getThrowable();
  +        else if (throwable instanceof ServletException)
  +            rootCause = ((ServletException) throwable).getRootCause();
  +	if (rootCause != null) {
  +            writer.println("----- Root Cause -----");
  +            rootCause.printStackTrace(writer);
   	}
  -
   	log(buf.toString());
   
       }
  
  
  

Mime
View raw message