tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Chaffee <>
Subject Stack Traces in standalone classes
Date Fri, 07 Jul 2000 13:13:09 GMT
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:


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

 - Alex

P.S. By the way, the point here is to make sure no exceptions are
silently swallowed -- that they all show up in a log file.  A big push
towards removing/streamlining log/debug messages to increase
performance will have to take place at a later date.

Alex Chaffee             
jGuru - Java News and FAQs
Creator of Gamelan       
Founder of Purple Technology
Curator of Stinky Art Collective

View raw message