You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Jacob Kjome <ho...@visi.com> on 2005/05/23 07:09:43 UTC

Re: Log4j logging under Tomcat5 (was Re: Multiple Projects Using Same Logger)

At 10:27 PM 5/22/2005 +0000, you wrote:
 >Now I have an unrelated question: I run the webapp under Tomcat 5.x.  When
 >the output level of the root logger is set to DEBUG, and I have log4j props
 >under WEB-INF/classes, I get a *ton* of Tomcat-output to logs.  Is this
 >because Tomacat itself uses log4j, and is reacting to the setting?
 >
 >I've seen the same behavior from JSF, running under Sun Web Server.

Tomcat shouldn't pick that up at all unless you've added log4j.jar *and* 
commons-logging.jar (not commons-logging-api.jar which excluded support for 
Log4j) to common/lib.  If this were the case, commons-logging would find 
and use Log4j in preference to other logger implementations.  I'm not 
completely sure how classes in common/lib would see log4j.properties in 
WEB-INF/classes, though?  Log4j uses the thread context classloader to 
locate/load the property file, but the thread wouldn't have been started 
from the webapp, so I don't see how that would come into play here?  Do 
you, somehow, have WEB-INF/classes of your webapp in the system classpath 
or something?  But if you use the startup scripts, Tomcat eschews the 
system classpath.  Hmmmmm....  In any case, this is very odd.  I'm not sure 
how this would happen?


Jake


 >
 >Regards,
 >
 >--A


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


Re: Log4j logging under Tomcat5 (was Re: Multiple Projects Using Same Logger)

Posted by Aron Bock <ar...@hotmail.com>.
>web apps!  I now think the more sane explanation is that I was hasty in my 
>offhand reporting, and that the "ton" of output I saw was from JSF, not 
>Tomcat.  That would make a little more sense, because all JSF jars are in 
>WEB-INF/lib of the webapp.  And, again, as mentioned, JSF was in the mix 
>when I noticed the same kind of copious output under Sun Web Server.
>
>I should set root logger to DEBUG and look more closely at the output.

FWIW, it seems that verbose output I saw was indeed from JSF; I've appended 
a couple lines below.  There's also output from "Digester", so I assume JSF 
uses that framework to work with faces-config.xml, et al.  Cute!

Anyway, all this just goes to show I should leave the root logger well 
enough alone.

Regards,

--A

[http8080-Processor24] DEBUG com.sun.faces.config.ConfigureListener - 
addRenderer(javax.faces.SelectMany,javax.faces.Listbox,com.sun.faces.renderkit.html_basic.ListboxRenderer)
[http8080-Processor24] DEBUG com.sun.faces.config.ConfigureListener - 
addRenderer(javax.faces.SelectMany,javax.faces.Menu,com.sun.faces.renderkit.html_basic.MenuRenderer)

_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


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


Re: Log4j logging under Tomcat5 (was Re: Multiple Projects Using Same Logger)

Posted by Aron Bock <ar...@hotmail.com>.
Hi Jacob, yes, I did think it odd that a web server/servlet container 
(Tomcat) should pick up a properties file in one of its web apps!  I now 
think the more sane explanation is that I was hasty in my offhand reporting, 
and that the "ton" of output I saw was from JSF, not Tomcat.  That would 
make a little more sense, because all JSF jars are in WEB-INF/lib of the 
webapp.  And, again, as mentioned, JSF was in the mix when I noticed the 
same kind of copious output under Sun Web Server.

I should set root logger to DEBUG and look more closely at the output.

Regards,

--A

>Log4j uses the thread context classloader to locate/load the property file, 
>but the thread wouldn't have been started from the webapp, so I don't see 
>how that would come into play here?  Do you, somehow, have WEB-INF/classes 
>of your webapp in the system classpath or something?  But if you use the 
>startup scripts, Tomcat eschews the system classpath.  Hmmmmm....  In any 
>case, this is very odd.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


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