You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Shapira, Yoav" <Yo...@mpi.com> on 2002/08/05 18:19:41 UTC

[OFF-TOPIC] RE: Log4j and Tomcat 4.0.3

Hi,
I marked this as off-topic, having become a log4j issue ;)

Your root logger needs to have at least one appender by the time you
make your first logging call ;)  And that appender should have a layout
;)

As an aside, you probably don't want to say
rootLogger=[LEVEL],[APPENDER-REF]
someOtherLogger=[LEVEL],[APPENDER-REF]

unless the appender references are different.  That will get you
duplicate log messages, as all the appenders have additivity set to true
by default.  See the section on additivity in the log4j manual and
JavaDoc.  

A more conventional configuration is:
rootLogger=[LEVEL],[APPENDER-REF]
someOtherLogger=[LEVEL]
or
rootLogger=[LEVEL],[APPENDER-REF]
someOtherLogger=[LEVEL],[OTHER-APPENDER-REF]

(and usually in the second case, you would set other-appender-ref
additivity to false).

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Alan Arvesen [mailto:aarvesen@eclyptic.com]
>Sent: Monday, August 05, 2002 12:14 PM
>To: Tomcat Users List
>Subject: RE: Log4j and Tomcat 4.0.3
>
>I'm dealing with the same issue right now.  It's addressed in the faq:
>
>http://jakarta.apache.org/log4j/docs/TROUBLESHOOT.html
>
>My log4j.properties looked like this:
>
>log4j.rootLogger=WARN,stdout
>log4j.logger.com.jags=WARN,stdout
>log4j.logger.com.eclyptic.home=ERROR,stdout
>
>I had never assigned "stdout" an appender and layout.  I added two
lines
>and it now works fine:
>
>log4j.rootLogger=WARN,stdout
>log4j.appender.stdout=org.apache.log4j.ConsoleAppender		# added
>log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# added
>log4j.logger.com.jags=WARN,stdout
>log4j.logger.com.eclyptic.home=ERROR,stdout
>
>
>so, basically, you need to apply an appender and a layout to something
in
>the "org.apache.coyote.http11.Http11Protocol" hierarchy, or just to
your
>rootLogger, and you're good to go.
>
>
>-----Original Message-----
>From: Dan Lipofsky [mailto:danlip@nuserve.com]
>Sent: Monday, August 05, 2002 11:07 AM
>To: Tomcat Users List
>Subject: Re: Log4j and Tomcat 4.0.3
>
>
>> log4j:WARN No appenders could be found for logger
>> (org.apache.coyote.http11.Http11Protocol).
>> log4j:WARN Please initialize the log4j system properly.
>
>Are you calling PropertyConfigurator.configure?
>We use tomcat 3.2.4, and have a JDP that runs on startup that calls
code
>like this
>
>public class Init {
>   public static void init() {
>        URL url = Init.class.getResource("log4j.properties");
>        PropertyConfigurator.configure(url);
>   }
>}
>
>If the startup JSP doesn't get called we get error messages like yours.
>- Dan
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:tomcat-user-
>unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:tomcat-user-
>help@jakarta.apache.org>
>
>
>--
>To unsubscribe, e-mail:   <mailto:tomcat-user-
>unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:tomcat-user-
>help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>