tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: Stack Traces in standalone classes
Date Fri, 07 Jul 2000 20:31:45 GMT
Alex Chaffee wrote:

> I've been going through and converting various printStackTrace() calls
> and System.out.println()s to use loghelper.log("reason", exception).
> This is safe even if there are no loggers yet, since if it can't find
> a good logger, it prints to System.err.  It also uses
> Logger.throwableToString, which is smart obout printing nested
> exceptions (ServletException and TomcatException -- hmm, it occurs to
> me that it should be smart about JDBCException too.)
> Certain classes feel like they want to be independent of all
> references to other Tomcat packages/classes.  Some even say so in the
> documentation.  To wit:
>         XmlMapper
>         SSLSocketFactory
>         AdaptiveClassLoader
> and probably a few others.
> Any strong feelings about using/not using the above logging technique
> in these classes?  I feel it's probably OK, since it's "just" Logger,
> and it's a known behavior that degrades gracefully in a non-Tomcat
> context.

A "non-Tomcat context" in which logging already causes grief is Catalina.
It does not utilize Tomcat's org.apache.tomcat.logging package itself
(based on philosophical reasons -- there will be people who want all
events from all components related to things like a particular virtual
host or a particular application logged to the same place), and has to go
to some pretty incredible pains to make a Tomcat-compatible logger
available for Jasper.

I would personally prefer that Tomcat 3.x logger dependencies *not* be
introduced into the classes you have listed above.

>  - Alex

Craig McClanahan

View raw message