tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reynir Hübner <rey...@hugsmidjan.is>
Subject RE: Logging
Date Mon, 20 Jan 2003 16:30:56 GMT

Yes, thanx Yoav, I am in fact using Log4J for webapplication specific logging, with very good
results.  

But sometimes exceptions occure where they should not occure (where they are not caught),
and  I get stacktraces printed out on to the tomcat console, but no information in wich application
the problem happens, only what kind of error and in which class. 

Can I configure Log4J to take everything that is printed to stdout and apply a pattern to
it and write out to a file ?
I think I need a logger that grabbs everything that comes out on the stdout (console) and
writes it out with log4j to a file, with a pattern. 
To clarify once more : I need logger that grabs unhandled exceptions written out to the console
and checks which application or classloader they occure in, and gives me more informative
information than just the stacktrace. 

Right now I'm looking at a way of developing such thing with log4j (of course)

thanx
-reynir


> -----Original Message-----
> From: Shapira, Yoav [mailto:Yoav.Shapira@mpi.com] 
> Sent: 20. janúar 2003 16:13
> To: Tomcat Users List; bcruz@norvax.com
> Subject: RE: Logging
> 
> 
> Howdy,
> Here's one way: use log4j.  Configure a file appender with 
> some pattern that includes your hostname in the MDC.  That's 
> exactly the sort of thing MDC (Mapped Diagnostic Context) in 
> log4j was designed for.  For more details, see the 
> PatternLayout and MDC class javadocs at 
> http://jakarta.apache.org/log4j/docs/api/index.html
> 
> If you have questions regarding usage of log4j, we'll be 
> happy to help you on the log4j user mailing list ;)
> 
> As an aside, I think tomcat already provides more than 
> adequate logging capabilities for a servlet container.  
> Tomcat is not a logging toolkit.  That's why we have things 
> like log4j ;)  Combine these two best of breed solutions and 
> you can enjoy a lot of benefits...
> 
> Yoav Shapira
> Millennium ChemInformatics
> 
> 
> >-----Original Message-----
> >From: Brandon Cruz [mailto:bcruz@norvax.com]
> >Sent: Monday, January 20, 2003 11:13 AM
> >To: Tomcat Users List
> >Subject: RE: Logging
> >
> >I have been trying to do the same thing, unfortunately I 
> have not found 
> >a way to make this happen yet.
> >
> >Brandon
> >
> >-----Original Message-----
> >From: Reynir Hübner [mailto:reynir@hugsmidjan.is]
> >Sent: Monday, January 20, 2003 9:59 AM
> >To: Tomcat Users List
> >Subject: Logging
> >
> >
> >Is it possible somehow to set the logger in tomcat 
> (FileLogger) so that 
> >it will tell which application the exception happenes. My problem is 
> >this : I have a server running serveral virtual hosts, most 
> running the 
> >same web-applications. When an exception is caused it gets 
> >stack-trace-printed to
> >the standard out, but it's impossible for me to determine 
> which application
> >it happenes in. Is it possible to configure the FileLogger 
> to display where
> >it happenes ?
> >
> >Thanx
> >-reynir
> >
> >--
> >To unsubscribe, e-mail: 
> ><mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> >For additional commands, e-mail: 
> ><mailto:tomcat-user-help@jakarta.apache.org>
> >
> >
> >
> >--
> >To unsubscribe, e-mail:   <mailto:tomcat-user-
> >unsubscribe@jakarta.apache.org>
> >For additional commands, e-mail: <mailto:tomcat-user- 
> >help@jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:tomcat-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <mailto:tomcat-user-help@jakarta.apache.org>
> 
> 

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


Mime
View raw message