tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remy Maucherat <remy.mauche...@gmail.com>
Subject Re: How to approximate tomcat-5.0/4.x/3.x logging in 5.5?
Date Tue, 01 Mar 2005 23:45:06 GMT
On Tue, 01 Mar 2005 18:18:49 -0500, Adrian Robert
<arobert@cogsci.ucsd.edu> wrote:
> I'm having trouble approximating the earlier tomcat per-context
> <Logger> functionality using log4j under tomcat-5.5.  Basically, I
> would like to have one file coming out under $CATALINA_BASE/logs/ per
> web application context.  This appears to be no longer possible through
> ServletContext.log().  So I tried using log4j:
> 
> 1) put log4j.jar, commons-logging.jar in common/lib AND
> webapps/*/WEB-INF/lib
> 2) put log4j.properties in common/classes AND webapps/*/WEB-INF/classes
> 
> However, I can't seem to find the right combination of log4j.properties
> lines, or maybe I'm trying something impossible.  (I can't find good
> docs on the uses of log4j.properties when used inside the hierarchical
> classloading context that tomcat provides.)  What keeps happening is
> that the webapp's log statements keep going into the global tomcat log.
>   Would I be better off with JDK logging instead?

I am working at the moment on a small package (which will be an
implementation of java.util.logging) which will allow you doing that
using the JDK logging. The main issue with it as supplied in the JDK
is that there is only one global configuration per JVM. The trick is
to make that per classloader, with delegation, so that webapps are
isolated. At the moment, I think log4j is your only choice
(unfortunately, I'm no expert, so I can't give you tricks with this
particular configuration).

In the same package, I will also provide a handler with daily rotation.

It should be done by the end of the week (it doesn't work at the
moment, I'm busy debugging ;) ).

-- 
xxxxxxxxxxxxxxxxxxxxxxxxx
Rémy Maucherat
Developer & Consultant
JBoss Group (Europe) SàRL
xxxxxxxxxxxxxxxxxxxxxxxxx

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


Mime
View raw message