You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Hayo Schmidt <st...@hayo.de> on 2003/08/25 14:01:36 UTC

Re: Tomcat Using Log4J ?

>Bottom line is that, if you want Log4j logging to work properly, make sure 
>log4j.jar is in WEB-INF/lib.

I had unwanted Debugging-Output from org.apache.commons.Digester and org.apache.commons.Digester.sax that made it impossible to continue to work. Everytime i started Tomcat i had to wait 10 minutes for the initialization of a tag library, because of that crap debug output.

This was the solution indeed. Thanks.

Hayo

Jacob Kjome schrieb:

>Quoting Lukas Bradley <lu...@somnia.com>:
>
>  
>
>>>Does Tomcat 4.1.24 initialize a Log4J instance?  It seems as if something
>>>      
>>>
>>is
>>    
>>
>>>stepping on my Log4J properties, and I don't know where it is.  The first
>>>thing my application does is start the plugin, but here is my log:
>>>      
>>>
>>It's actually Commons Digester.  When I set it to a DEBUG level, it goes
>>CRAZY on the log.
>>
>>Is there any way to ensure that my log properties get set before Digester
>>starts?
>>
>>    
>>
>
>That Depends.  Where do you have Log4j; in common/lib, WEB-INF/lib, or both?  
>Is digester in your WEB-INF/lib or is it Tomcat's copy of digester which reads 
>the server.xml and other xml config files?  Note that the trouble is usually 
>the fault of commons-logging which messes things up significantly.  Do you have 
>commons-logging in your WEB-INF/lib?
>
>Bottom line is that, if you want Log4j logging to work properly, make sure 
>log4j.jar is in WEB-INF/lib.  Then, nothing else will step on your 
>configuration except for, possibly, other 3rd party libraries in WEB-INF/lib 
>that perform Log4j configuration (which is a big no, no...general libraries 
>shouldn't be performing Log4j configuration, they should leave that to your 
>application).  Put your config file in WEB-INF/classes for default log4j 
>configuration or put it wherever and load it yourself.  I suggest using a 
>servlet context listener to load configuration upon startup.
>
>Anway, until you detail the setup of your application, I can't tell you much 
>more.
>
>BTW, you really should remove Xerces from WEB-INF/lib.  This should be loaded 
>from common/lib.  The explanation has been detailed on the list many times 
>before so I won't go into it.
>
>Jake
>
>  
>
>>Lukas
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>  
>