tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Chaffee <g...@edamame.stinky.com>
Subject Per-component logging
Date Tue, 04 Jul 2000 08:03:24 GMT
So it sounds like some people really like per-component debug levels,
and some don't.  May I suggest the following compromise architecture:

Component code can send all the regular verbosity levels, like ERROR,
WARN, INFORMATION, DEBUG.

Component checks its internal debug level before sending a message
with verbosity DEBUG.

Logger only prints messages onto streams with high enough log levels,
including DEBUG.

That means that if you want spew-level output for component Foo, which
outputs to "tc_log", you must (a) set the "debug" attribute for Foo to
9 or 99 or whatever, and (b) set the "verbosityLevel" of the "tc_log"
Logger object to "DEBUG".

In other words, the component would have first crack, but the Logger
has ultimate veto.  That way you can easily crank down the verbosity
level globally, or set the Logger setting to DEBUG, in which case all
components will be allowed to speak, but only the components you've
set the "debug" attribute on will want to.
 
It's really quite simple :-)

 - Alex

P.S. This would also require a little discipline, calling
loghelper.debug() instead of loghelper.log() or System.out.println(),
to work right.

-- 
Alex Chaffee                       mailto:alex@jguru.com
jGuru - Java News and FAQs         http://www.jguru.com/alex/
Creator of Gamelan                 http://www.gamelan.com/
Founder of Purple Technology       http://www.purpletech.com/
Curator of Stinky Art Collective   http://www.stinky.com/

Mime
View raw message