Hello Dan, You are going to have to Buy Ceki Gülcü's book and look at the section about Repository Selectors. Since log4j's configuration is static, the first app that configures log4j will have configured it for all contexts which is almost certainly not what you want. You want your config file to be specific for your app. That is where Repository Selectors come in. I haven't read much about them, so I can't go into detail, but Ceki's book should answer just about any question you may have on Log4j.
Actually, I spoke too quickly. Look at this excerp from the book.... http://qos.ch/containers/sc.html See about the book here: http://qos.ch/log4jBook.html Jake Wednesday, October 02, 2002, 11:22:31 AM, you wrote: DL> Is there a way to control this? DL> Suppose I do want to put log4j.jar in common/lib (because I DL> don't want to wrap it in the war and reinstall it every time). DL> But I want it only to be used by my application. DL> Can I do this? DL> - Dan >> There's a library called common-lib that uses any of log systems you have. >> Modjk2 uses it, so if you put log4j in common/lib modjk2 will use it. If DL> you >> put modjk2 it in your webbapps directory, then only your application can >> reach it. >> >> Regards >> >> -----Mensaje original----- >> De: Maxime Colas des Francs [mailto:[EMAIL PROTECTED]] >> Enviado el: miércoles, 02 de octubre de 2002 14:52 >> Para: Tomcat Users List >> Asunto: log4j & tomcat >> >> Hi, >> >> I want to use log4j in a tomcat 4.1.10 web application. >> and I think I don't understand relation between tomcat and log4j. >> >> I have a log4j-1.2.6.jar >> >> If i don't put it anywhere i have a : >> java.lang.NoClassDefFoundError: org/apache/log4j/PropertyConfigurator >> in my 'onload' servlet (so i think it's nomal and i think log4j is not >> integrate in tomcat) >> >> If i put this jar in $CATALINA_HOME/common/lib, >> it seems that tomcat and mod_jk2 libs use it and log in my application log >> ?!? >> (and not a little ...) >> DEBUG 2002-10-02 08:40:00,326 [main] >> org.apache.jk.server.JkMain.processProperty(JkMain.java:468) : Processing >> handler::handler list >> DEBUG 2002-10-02 08:40:00,359 [main] >> org.apache.jk.server.JkMain.processProperty(JkMain.java:468) : Processing >> apr::apr NativeSo >> DEBUG 2002-10-02 08:40:00,367 [main] >> org.apache.jk.server.JkMain.processProperty(JkMain.java:481) : Setting >> NativeSo on apr org.apache.jk.apr.AprImpl@26dbec >> DEBUG 2002-10-02 08:40:00,371 [main] >> org.apache.jk.server.JkMain.setBeanProperty(JkMain.java:359) : setProperty >> org.apache.jk.apr.AprImpl@26dbec >> ... etc ... >> >> If i put it in $CATALINA_HOME/webapps/myapp/WEB-INF/lib, >> only my application log in my log file as expected. >> >> Do you know why ?? >> Can i put it in common/lib and tell tomcat to stop log in my application DL> log >> ? >> >> Thanks. >> >> My log configuration : >> >> log4j.rootCategory=DEBUG, textFile >> log4j.appender.textFile=org.apache.log4j.DailyRollingFileAppender >> log4j.appender.textFile.layout=org.apache.log4j.PatternLayout >> log4j.appender.textFile.layout.ConversionPattern=%-5p %d [%t] %l : %m%n >> log4j.appender.textFile.DatePattern='.'yyyy-MM-dd >> log4j.appender.textFile.File=/usr/local/tomcat/webapps/myapp/logs/log.txt DL> -- DL> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> DL> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- Best regards, Jacob mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>