On 11/10/06, Ping Yu <[EMAIL PROTECTED]> wrote:
Nov 9, 2006 2:35:23 PM org.apache.catalina.startup.HostConfig
deployWAR
INFO: Deploying web application archive test.war log4j:WARN No
appenders could be found for logger (org.apache.commons.digester.Digester).
log4j:WARN Please initialize the log4j system properly.
digester.jar is in my classpath and I didn't use any log4j.property
file in my application directly.
This is exactly why you are getting the warnings. As I said last week,
you need a log4j.xml or log4j.properties somewhere in your WAR
classpath (under WEB-INF will work).
I have the following questions:
1) Who initializes Digester logger? Tomcat or Struts? How to get to
know?
2) When is Digester loaded? How can I get to know? I am using
MyEclipse. Are there any ways to trace the loading of Digester logger?
3) Since I am not using log4j or Digester directly in my application,
are there any ways that I can load my own log class before
Tomcat/Struts load Digester logger?
The digester is used by Struts to load XML configuration information
for your web application, so therefore is instantiated when an app is
deployed (as web.xml is procesed IIRC).
Some apps use Jakarta Commons logging which allows one to change the
logger that is used. Off the top of my head I don't know what Digester
or Struts uses, you can probably google for this answer. But I think
this is beyond the scope of your question.
If you are not using log4j for your own application logging and don't
care about messages from the Struts infrastructure, then just put a
log4j.xml file with a minimum of info in it, see
http://logging.apache.org/log4j/docs how to do this.
You could create a context listener which is fired when the
application starts up, but it is much simpler to just put a minimal
log4j.xml file in your classpath, which would solve your problems with
this.
HTH,
-ed
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]