logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject RE: New issue on Log4J initialization
Date Mon, 11 Aug 2003 19:48:38 GMT
When you say version "5.0", do you literally mean version "5.0" or the 
latest version of the 5.0 series which is 5.0.7?  I tested on 5.0.7 and 
don't get the message at all if log4j.jar is *not* in common/lib.  I do get 
the message (but actually a slightly different one) if log4j.jar *is* in 
common/lib.  However, I can fix this by adding the following log4j.xml file 
to common/classes....

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" 
debug="false" threshold="debug">
     <appender name="A1" class="org.apache.log4j.ConsoleAppender">
         <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern" value="%-4r [%t] %-5p %c %x - 
%m%n"/>
         </layout>
     </appender>

     <root>
         <level value="info"/>
         <appender-ref ref="A1"/>
     </root>
</log4j:configuration>

I suggest upgrading to Tomcat-5.0.7 if you haven't already and add the 
above log4j.xml to common/classes.

Jake

At 03:24 PM 8/11/2003 -0400, you wrote:
>Yes it is a clean install (version 5.0).  I decided that since I could get
>logging to work with v4.1.27 that I would re-try v5.0 again.
>
>One thing that I noticed was that there was log4j path information in my
>classpath, so I took that out.  I rebooted the machine and tried to start
>Tomcat again.  I got the same appender messages.
>
>-----Original Message-----
>From: Jacob Kjome [mailto:hoju@visi.com]
>Sent: Monday, August 11, 2003 2:49 PM
>To: Log4J Users List
>
>What version of Tomcat are you using?  And is it a clean install?  That is,
>a stock install with nothing else added to it.
>
>Jake
>
>At 02:10 PM 8/11/2003 -0400, you wrote:
> >Jake,
> >
> >Before I go on I want to thank you for all your help and patience.
> >
> >I decided to test something out and totally removed my application and all
> >instances of our log4j-1.2.8 jar file.
> >
> >Guess what happens?
> >
> >I still get the error:
> >
> >"Log4j: WARN No appenders could be found for logger
> >org.apache.commons.digester.Digester.sax).  Please initialize the log4j
> >system properly."
> >
> >What are your thoughts about this?
> >
> >Thanks again.
> >
> >Tim
> >
> >-----Original Message-----
> >From: Jacob Kjome [mailto:hoju@visi.com]
> >Sent: Monday, August 11, 2003 10:45 AM
> >To: Log4J Users List
> >
> >At 09:25 AM 8/11/2003 -0400, you wrote:
> > >Jake,
> > >
> > >Having done as you said I am now getting a log file generated
> >
> >Glad you got things going.  What do you think was the difference?  Can you
> >pinpoint the one change that made things start working?  It would be good
> >to know for future users having the same or similar problems.
> >
> > >, although I
> > >still get the original error message from Tomcat:
> > >
> > >"Log4j: WARN No appenders could be found for logger
> > >org.apache.commons.digester.Digester.sax).  Please initialize the log4j
> > >system properly."
> > >
> > >Any way to get that message to stop displaying?
> >
> >Did you put a copy of log4j.jar back into common/lib?  That error is coming
> >from commons-logging finding Log4j and using it in preference to j2sdk1.4.x
> >logging, but if Log4j doesn't, then, find its configuration, you will get
> >that error.  Note that commons-logging does a bunch of classloading
> >trickery to find and load external logging packages.  It is entirely
> >possible that it might be using the context class loader to find Log4j,
> >thus being able to bypass the normal Java2 classloader hierarchy (where
> >only classloader higher in the hierarchy are visible).  However, I just
> >tested having log4j.jar in my WEB-INF/lib and not in common/lib and
> >commons-logging in common/lib couldn't see it (and, therefore, didn't get
> >the Log4j error), so it is most likely that you have log4j.jar in
> >common/lib (or shared/lib) or some other place where commons-logging in
> >Tomcat can see log4j.jar.  Remove Log4j.jar and you won't see that
> >error....or, I suppose, you could add log4j.xml or log4j.properties to
> >common/classes and all would be well.
> >
> >Jake
> >
> > >-----Original Message-----
> > >From: Jacob Kjome [mailto:hoju@visi.com]
> > >Sent: Monday, August 11, 2003 2:05 AM
> > >To: Log4J Users List
> > >
> > >Hi Timothy,
> > >
> > >This is why, when possible, I install apps manually by simply unzipping
> > >them to a directory rather than running some fancy install which I have
>no
> > >control over.  I do this with Tomcat.  I suppose this isn't possible with
> > >current versions of Websphere, but they really shouldn't be modifying
>your
> > >classpath anyway.  I'd send them a complaint about this so that they stop
> > >this practice in the future.  Their batch scripts should set everything
>up
> > >dynamically rather than modify the system CLASSPATH variable.
> > >
> > >Anyway, you can achieve this yourself by opening a command prompt and
> >doing:
> > >set CLASSPATH .
> > >
> > >Now run Tomcat from there (although the default scripts should ignore the
> > >classpath anyway, now that I think about it).
> > >
> > >Anyway, try that out.  If that doesn't help, maybe if you have a sample
> > >application you can send to me, I can test it out myself to see if I get
> > >logging or not.  Some source code would also be good so I know where to
> > >expect logging statements to come from.
> > >
> > >Jake
> > >
> > >At 01:27 PM 8/8/2003 -0400, you wrote:
> > > >Keith,
> > > >
> > > >The problem I have with removing all that stuff is that 90% of it was
>put
> > > >there by applications.  Should I remove parts of it anyway?  I guess
> >that's
> > > >where my confusion is since (as I said) most of these variables were
> > >entered
> > > >by the installation of the applications themselves.
> > > >
> > > >Thanks for your thoughts Keith!
> > > >
> > > >-----Original Message-----
> > > >From: Keith Hatton [mailto:khatton@axiomsystems.com]
> > > >Sent: Friday, August 08, 2003 12:18 PM
> > > >To: Log4J Users List
> > > >
> > > >single period = . = class files etc. based on this directory only.
> > > >
> > > >It's just that the CLASSPATH environment variable often does more harm
> >than
> > > >good.
> > > >If you use java -cp <something> then the CLASSPATH is ignored, and
>often
> > > >scripts that start Java apps will do just that. But then again,
>sometimes
> > > >they add your CLASSPATH to theirs. That's when the trouble starts ...
> > > >
> > > >So basically, Jake's advice is, "remove your CLASSPATH environment
> >variable
> > > >if at all possible. Certainly that sounds like way too much junk in
> >there."
> > > >
> > > >Hope this helps
> > > >Keith
> > > >
> > > >
> > > >-----Original Message-----
> > > >From: Farrell, Timothy [mailto:Timothy.Farrell@Compuware.com]
> > > >Sent: 08 August 2003 17:00
> > > >To: Log4J Users List
> > > >Subject: RE: New issue on Log4J initialization
> > > >
> > > >
> > > >Can you (or someone)explain your first statement (I'd change your
> >classpath
> > > >to be no more than a single period)?
> > > >
> > > >I have both installed on my machine however, I only run one at a time
> > > >depending on what I am working on.
> > > >
> > > >My app does not use struts or anything else requiring commons-logging.
> > > >
> > > >Jake,
> > > >
> > > >Enjoy your vacation!  And thanks again.
> > > >
> > > >-----Original Message-----
> > > >From: Jacob Kjome [mailto:hoju@visi.com]
> > > >Sent: Friday, August 08, 2003 11:49 AM
> > > >To: Log4J Users List
> > > >
> > > >
> > > >Yikes.  I'd change your classpath to be no more than a single period.
> >Set
> > > >the classpath as needed in scripts.  That way, you won't force
>libraries
> > > >that aren't needed or collide with other libraries on every app you
>run.
> > > >
> > > >Just to be clear.  Are you running Tomcat or Websphere?  I can't tell
>you
> > > >what the behavior in Websphere will be.  Tomcat should definitely work
> >for
> > > >logging, though.
> > > >
> > > >BTW, what does your app consist of?  Does it use Struts or anything
>else
> > > >requiring commons-logging?  That's the most evil invention to come out
>of
> > > >the Apache project.  In my experience, it just messes up everything.
>If
> > > >this is an issue with commons-logging, you'll have to take it up with
> >them.
> > > >
> > > >BTW, I will be leaving for a mini vacation shortly, so someone else is
> > > >probably going to have to take the reins on this one if you require
>more
> > > >help.
> > > >
> > > >good luck!
> > > >
> > > >Jake
> > > >
> > > >At 11:11 AM 8/8/2003 -0400, you wrote:
> > > > >Actually that is the message I am getting (I just abbreviated it a
> >bit).
> > > > >
> > > > >In my application the log4j.jar file does not exist in the common/lib
> > > > >directory of Tomcat.  This file only exists in the web-inf/lib
> >directory
> > >of
> > > > >my application.
> > > > >
> > > > >Could this be attributed to my environmental settings:
> > > > >.;E:\Program Files\IBM\WebSphere MQ\Java\lib\providerutil.jar;
> > > > >E:\Program Files\IBM\WebSphere MQ\Java\lib\com.ibm.mqjms.jar;
> > > > >E:\Program Files\IBM\WebSphere MQ\Java\lib\ldap.jar;
> > > > >E:\Program Files\IBM\WebSphere MQ\Java\lib\jta.jar;
> > > > >E:\Program Files\IBM\WebSphere MQ\Java\lib\jndi.jar;
> > > > >E:\Program Files\IBM\WebSphere MQ\Java\lib\jms.jar;
> > > > >E:\Program Files\IBM\WebSphere MQ\Java\lib\connector.jar;
> > > > >E:\Program Files\IBM\WebSphere MQ\Java\lib\fscontext.jar;
> > > > >E:\Program Files\IBM\WebSphere MQ\Java\lib\com.ibm.mq.jar;
> > > >
> >E:\jakarta-log4j-1.2.8\dist\lib\log4j-1.2.8;E:\istrobe20jars\dom4j.jar;
> > > > >E:\Tomcat 4.1\common\lib\servlet.jar;
> > > > >E:\Tomcat 4.1\bin\bootstrap.jar;
> > > > >E:\Sandbox\build\classes;
> > > > >C:\j2sdk1.4.1_01\bin;
> > > > >E:\Ant1.5.3\apache-ant-1.5.3-1\lib\ant.jar;
> > > > >E:\Ant1.5.3\apache-ant-1.5.3-1\lib\optional.jar
> > > > >
> > > > >Thanks for hanging in there.
> > > > >
> > > > >Sincerely,
> > > > >
> > > > >Tim
> > > > >
> > > > >-----Original Message-----
> > > > >From: Jacob Kjome [mailto:hoju@visi.com]
> > > > >Sent: Friday, August 08, 2003 10:57 AM
> > > > >To: Log4J Users List
> > > > >
> > > > >
> > > > >There doesn't appear to be anything wrong with your log4j.xml (except
> > >that
> > > > >you should use <level> rather than <priority>, but that
isn't the
>issue
> > > > >here).
> > > > >
> > > > >Note that the error you've mentioned in previous emails is not an
>issue
> > > > >here...
> > > > >
> > > > >"Log4j: WARN No appenders could be found for logger
> > > > >(org.apache.commons.digester.Digester.sax).  Please initialize the
> >log4j
> > > > >system properly."
> > > > >
> > > > >I'd bet that goes away if you remove log4j.jar from
> > > > >CATALINA_HOME/common/lib (please test this out).  Having log4j.jar
in
> > > > >WEB-INF/lib of your application provides for a separate logging
> > >environment
> > > > >since it is in a distinct classloader.
> > > > >
> > > > >I'm at a loss as to why you are not seeing debug message?  You are
> > >running
> > > > >code that does logger.debug(), right?
> > > > >
> > > > >Anyone else have a clue what is happening here?
> > > > >
> > > > >
> > > > >Jake
> > > > >
> > > > >At 09:49 AM 8/8/2003 -0400, you wrote:
> > > > > >Can anyone see anything wrong with this log4j.xml file?  For
some
> > >reason
> > > >I
> > > > > >cannot get lof4j to initialize and it's driving me crazy.  I
am
>sure
> >it
> > > >is
> > > > > >something I am doing wrong but I can't seem to locate the problem.
> > > > > >
> > > > > >The error message I am getting is:
> > > > > >
> > > > > >No appenders could be found for logger.  Please initialize the
>log4j
> > > >system
> > > > > >properly .
> > > > > >
> > > > > >Here is the log4j file:
> > > > > >
> > > > > ><?xml version="1.0" encoding="UTF-8" ?>
> > > > > ><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
> > > > > ><!-- For Ant build -->
> > > > > ><log4j:configuration>
> > > > > ><!-- order of elements: renderer*, appender*, (category |
...) ,
>root
> > >-->
> > > > > >
> > > > > >     <appender name="LF5" class="org.apache.log4j.lf5.LF5Appender">
> > > > > >         <param name="MaxNumberOfRecords" value="1000"/>
> > > > > >     </appender>
> > > > > >
> > > > > >     <appender name="file"
> > >class="org.apache.log4j.RollingFileAppender">
> > > > > >         <param name="file" value="build.log"/>
> > > > > >         <param name="maxBackupIndex" value="3"/>
> > > > > >         <param name="maxFileSize" value="100KB"/>
> > > > > >         <layout class="org.apache.log4j.TTCCLayout"/>
> > > > > >     </appender>
> > > > > >
> > > > > >     <!-- if using this in ant, be sure the java mail libraries
are
> > > > >avaiable
> > > > > >-->
> > > > > >     <appender name="mail"
>class="org.apache.log4j.net.SMTPAppender">
> > > > > >         <param name="Threshold" value="debug"/>
> > > > > >         <param name="SMTPHost" value="bh1.compuware.com"/>
> > > > > >         <param name="bufferSize" value="1"/>
> > > > > >         <param name="to" value="timothy.farrell@compuware.com"/>
> > > > > >         <param name="from" value="timothy.farrell@compuware.com"/>
> > > > > >         <param name="subject" value="Ant test"/>
> > > > > >         <layout class="org.apache.log4j.HTMLLayout"/>
> > > > > >     </appender>
> > > > > >
> > > > > >         <appender name="STDOUT"
> > > >class="org.apache.log4j.ConsoleAppender">
> > > > > >         <layout class="org.apache.log4j.PatternLayout">
> > > > > >             <param name="ConversionPattern" value="[%t] %C{2}
> >(%F:%L)
> > >-
> > > > > >%m%n"/>
> > > > > >         </layout>
> > > > > >         </appender>
> > > > > >
> > > > > >         <root>
> > > > > >             <priority value="debug" />
> > > > > >             <appender-ref ref="STDOUT" />
> > > > > >         <appender-ref ref="file"/>
> > > > > >    <!--     <appender-ref ref="mail"/> -->
> > > > > >    <!--     <appender-ref ref="LF5"/> -->
> > > > > >         </root>
> > > > > >
> > > > > ></log4j:configuration>
> > > > > >
> > > > > >Thank you for your help.
> > > > > >
> > > > > >
> > > > > >
> > > > > >The contents of this e-mail are intended for the named addressee
> >only.
> > >It
> > > > > >contains information that may be confidential. Unless you are
the
> >named
> > > > > >addressee or an authorized designee, you may not copy or use
it, or
> > > > >disclose
> > > > > >it to anyone else. If you received it in error please notify
us
> > > >immediately
> > > > > >and then destroy it.
> > > > > >
> > > > > >
> > > > >
> >---------------------------------------------------------------------
> > > > > >To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> > > > > >For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> > > > >
> > > > >
> > > > >---------------------------------------------------------------------
> > > > >To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> > > > >For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> > > > >
> > > > >
> > > > >
> > > > >The contents of this e-mail are intended for the named addressee
>only.
> >It
> > > > >contains information that may be confidential. Unless you are the
>named
> > > > >addressee or an authorized designee, you may not copy or use it, or
> > > >disclose
> > > > >it to anyone else. If you received it in error please notify us
> > >immediately
> > > > >and then destroy it.
> > > > >
> > > > >
> > > > >---------------------------------------------------------------------
> > > > >To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> > > > >For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> > > >
> > > >
> > > >---------------------------------------------------------------------
> > > >To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> > > >For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> > > >
> > > >
> > > >
> > > >The contents of this e-mail are intended for the named addressee only.
>It
> > > >contains information that may be confidential. Unless you are the named
> > > >addressee or an authorized designee, you may not copy or use it, or
> > >disclose
> > > >it to anyone else. If you received it in error please notify us
> >immediately
> > > >and then destroy it.
> > > >
> > > >
> > > >---------------------------------------------------------------------
> > > >To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> > > >For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> > > >
> > > >
> > > >---------------------------------------------------------------------
> > > >To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> > > >For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> > > >
> > > >
> > > >
> > > >The contents of this e-mail are intended for the named addressee only.
>It
> > > >contains information that may be confidential. Unless you are the named
> > > >addressee or an authorized designee, you may not copy or use it, or
> > >disclose
> > > >it to anyone else. If you received it in error please notify us
> >immediately
> > > >and then destroy it.
> > > >
> > > >
> > > >---------------------------------------------------------------------
> > > >To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> > > >For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> > >
> > >
> > >
> > >The contents of this e-mail are intended for the named addressee only. It
> > >contains information that may be confidential. Unless you are the named
> > >addressee or an authorized designee, you may not copy or use it, or
> >disclose
> > >it to anyone else. If you received it in error please notify us
>immediately
> > >and then destroy it.
> > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> >
> >
> >
> >The contents of this e-mail are intended for the named addressee only. It
> >contains information that may be confidential. Unless you are the named
> >addressee or an authorized designee, you may not copy or use it, or
>disclose
> >it to anyone else. If you received it in error please notify us immediately
> >and then destroy it.
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>
>
>
>The contents of this e-mail are intended for the named addressee only. It
>contains information that may be confidential. Unless you are the named
>addressee or an authorized designee, you may not copy or use it, or disclose
>it to anyone else. If you received it in error please notify us immediately
>and then destroy it.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org


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


Mime
View raw message