commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Herrmann <...@jadn.com>
Subject Re: [logging] Redirecting System.out to JDK1.4 Logging for tomcat
Date Thu, 25 Jul 2002 11:42:51 GMT
On Thu, 2002-07-25 at 07:13, Remy Maucherat wrote:
> Bob Herrmann wrote:
> > I don't know if anyone else will find this interesting, but I wrote a
> > class which redirects System.Out to JDK1.4 Logging.  It is Tomcat 
> > aware and unrolls the stack in a way useful for Tomcat.  This might be
> > useful if you are embedding Tomcat.
> > 
> > I changed catalina.sh to start my class, it then invokes Bootstrap.
> > 
> > Any comments?
> 
> AFAIK, Glenn used the Jasper sys.out redirector (and put it in 
> j-t-c/util) to do that. It doesn't redirect everything, but I believe it 
> redirects everything significant.
> 
> The advantages are:
> - It then redirects to one of the Catalina loggers
> - It doesn't depend on JDK 1.4

True.  My approach is tuned for 2 things,
 - utilizing JDK 1.4 logging 
 - unrolling the Tomcat stack in a way to get to "interesting bits of
stack"

You are right that this isn't something everyone would want.  If you are
trying to get Tomcat to log though JDK 1.4, then my approach might be
useful.  

The stack unrolling is helpful, IMHO, because it helps to identify which
class and method called the logger.  

I would like to have used commons-logging to get to JDK1.4's backend. 
Alas commons-logging doesn't support arbitrary stack unrolling
methods... And Tomcat has a lot of log wrappers....

$ cd jakarta-tomcat-4.0
$ grep -i 'log(' `find . -name *.java `|grep void|cut -f1
-d:|sort|uniq|wc -l
     65

To migrate to commons-logging, it looks like at least 65 classes need to
be adjusted.  I presume this will take awhile.  Using my approach is a
quick stop gap.   Perhaps Tomcat 5 will embrace the migration to
commons-logging.

Cheers,
-bob

Related Thread:
http://www.mail-archive.com/tomcat-dev@jakarta.apache.org/msg28257.html



> 
> Remy
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message