You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Tim Funk <fu...@joedog.org> on 2003/06/21 19:46:46 UTC
[5] Nested exception logging
When exceptions are nested multiple times inside of ServletExcpetions -
occasionally the true root cause is not logged (to disk). This complaint
occasionally appears on the user list. I think the problem is due to
StandardWrapperValve using commons-logging and commons-logging knows nothing
about nested exceptions. (At least with respect to ServletException)
A fix could be this (which I don't like and would probably be -1'd by
someone). So I have a few questions about the possible patch below:
- Is this correct - its *ugly* in its output but it seems to work
- Is this the only place to fix?
- Is there a better alternative?
- Or did I completely miss something?
-Tim
RCS file:
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardWrapperValve.java,v
retrieving revision 1.15
diff -u -b -r1.15 StandardWrapperValve.java
--- StandardWrapperValve.java 26 May 2003 22:03:59 -0000 1.15
+++ StandardWrapperValve.java 21 Jun 2003 17:38:15 -0000
@@ -286,6 +286,17 @@
hreq.removeAttribute(Globals.JSP_FILE_ATTR);
log.error(sm.getString("standardWrapper.serviceException",
wrapper.getName()), e);
+ Throwable rootCause = e.getRootCause();
+ while (rootCause!=null) {
+ log.error(sm.getString("standardWrapper.serviceException",
+ wrapper.getName()), rootCause);
+
+ if (rootCause instanceof ServletException)
+ rootCause = ((ServletException) rootCause).getRootCause();
+ else
+ rootCause = null;
+ }
+
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org