RE: Tomcat Logging.. whats the best way ?

2004-06-22 Thread Mike Curwen
I believe that it's 'normal' to use a logging package, rather than
system.out to perform debug logging.  A package like log4j has many
advantages including:
1) It's popular (so you get support and lots of people can help)
2) It's super-configurable (you can turn each class/package on or off,
or adjust its logging level)
3) It's not system.out  (which may not always be under your control)


 -Original Message-
 From: Ben Bookey [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, June 22, 2004 10:02 AM
 To: Tomcat User List
 Subject: Tomcat Logging.. whats the best way ?
 
 
 
 Dear List,
 
 We have written a webapp, and now I want to add some logging 
 inside. The app has jsp pages, servlets and a java package of 
 classes for jdbc database interaction.
 
 O.k. as I understood Tomcat does support logging via, 
 catalina.out etc. The logfile can even be configured based on 
 each web descriptor web.xml file. This seems quite flexible 
 until you want to start monitoring whats going on inside of 
 the com.package, not just inside the servlet container. So it 
 seems to me that we need to create/use a logger class (e.g.
 log4j)
 for the package.
 
 Am i right in understanding that its normal-case to use a 
 log4j type method of logging denug info for internal 
 purposes. Its not recommended to use JUST Tomcat logging for 
 the complete web app.?
 
 Would appreciate any view,
 
 regards
 BB
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat Logging.. whats the best way ?

2004-06-22 Thread Benson Margulies
Sure, but the other question is this:

ServletContext.log allows a webapp to log. Wouldn't It Be Nice if that
same log was somehow available to any old bit-o-java when running in the
environment?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat Logging.. whats the best way ?

2004-06-22 Thread Jacob Kjome
Quoting Benson Margulies [EMAIL PROTECTED]:

 Sure, but the other question is this:
 
 ServletContext.log allows a webapp to log. Wouldn't It Be Nice if that
 same log was somehow available to any old bit-o-java when running in the
 environment?
 

So, you want all logging to go to the servlet context log file for the
application?  So use the ServletContextLogAppender from the logging-log4j-sandbox...
http://cvs.apache.org/viewcvs.cgi/logging-log4j-sandbox/src/java/org/apache/log4j/servlet/ServletContextLogAppender.java

See also:
http://nagoya.apache.org/wiki/apachewiki.cgi?Log4JProjectPages/AppContainerLogging


Jake

 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]