You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Keir Bowden <Ke...@emea.telerate.com> on 2004/07/27 17:58:45 UTC

Help with Log4j

Hi,
 
I'm having trouble getting log4j to work in conjunction with commons
logging, Axis 1.0 and Tomcat 5.0.19.  I've tried altering the
log4j.properties in the axis.jar file, adding the log4j jar file to the
tomcat shared\lib, common\lib and server\lib directories, adding
log4j.properties files in the tomcat shared\classes, common\classes,
server\classes and the axis\WEB-INF\classes directories, all to no avail.
 
I've googled on this with all combinations of tomcat, axis and log4j that I
can think of, but I just can't seem to coax anything other than the INFO
level debugging into the tomcat\logs\stdout.log file that I had upon first
installation of tomcat. 
 
I'm using the LogFactory.getLog() method from commons logging, which should
choose log4j if possible.  However, when I output the Log object that is
returned, it's an org.apache.commons.logging.impl.Jdk14Logger.
 
I've been banging my head against this one for three days now - has anyone
out there managed to get this combination working?   Any and all tips
gratefully received.

Keir Bowden
Development Consultant

Telerate 
Winchmore House, 
15 Fetter Lane, London EC4A 1BW 
(w) +44 (0) 207 832 9839 
 (e) keir.bowden@emea.telerate.com 
http://www.telerate.com <http://www.telerate.com/> 
"Our company name has changed to Telerate. Please note my email address is
keir.bowden@emea.telerate.com."

 

#####################################################################
                           CONFIDENTIALITY NOTICE
The information contained in this email is confidential and may also 
be privileged. It is intended to be for the exclusive use of the 
addressee(s) and access to it by any other person is unauthorised.
If you are not the addressee please note that you must not distribute,
copy, circulate or in any other way use or rely on the information 
contained in this email.  If you have received this email in error 
please notify us by phone (+44 (0)20 7832 9000) and then destroy the 
email and any copies of it.
######################################################################

Re: Help with Log4j

Posted by Eric Bloch <bl...@laszlosystems.com>.
I eventually made this work in tomcat 5.0.24 and wasted lots of time on 
it, too.  The @#&*(! commons-logging combined with the fact that tomcat 
uses it itself, makes for all sorts of possible problems.  It seems to 
me all commons-logging really is .... is a class-loader that breaks 
inside servlet containers in different ways depending on how the 
container does its own class loading and how the container uses or 
doesn't use commons-logging itself.

The trick for me was to add commons-logging.jar (impl not api jar) and 
log4j-1.2.x.jar to $TOMCAT_HOME/common/lib .  I also made sure that the 
version of commons-logging.jar that I added to $TOMCAT_HOME/common/lib 
matched the version of the commons-logging-api.jar in $TOMCAT_HOME/bin

Good luck!

-Eric




Keir Bowden wrote:

> Hi,
>  
> I'm having trouble getting log4j to work in conjunction with commons 
> logging, Axis 1.0 and Tomcat 5.0.19.  I've tried altering the 
> log4j.properties in the axis.jar file, adding the log4j jar file to the 
> tomcat shared\lib, common\lib and server\lib directories, adding 
> log4j.properties files in the tomcat shared\classes, common\classes, 
> server\classes and the axis\WEB-INF\classes directories, all to no avail.
>  
> I've googled on this with all combinations of tomcat, axis and log4j 
> that I can think of, but I just can't seem to coax anything other than 
> the INFO level debugging into the tomcat\logs\stdout.log file that I had 
> upon first installation of tomcat. 
>  
> I'm using the LogFactory.getLog() method from commons logging, which 
> should choose log4j if possible.  However, when I output the Log object 
> that is returned, it's an org.apache.commons.logging.impl.Jdk14Logger.
>  
> I've been banging my head against this one for three days now - has 
> anyone out there managed to get this combination working?   Any and all 
> tips gratefully received.
> 
> Keir Bowden
> Development Consultant
> 
> Telerate
> Winchmore House,
> 15 Fetter Lane, London EC4A 1BW
> (w) +44 (0) 207 832 9839
>  (e) keir.bowden@emea.telerate.com
> http://www.telerate.com <http://www.telerate.com/>
> "Our company name has changed to Telerate. Please note my email address 
> is keir.bowden@emea.telerate.com."
> 
>  
> ------------------------------------------------------------------------
> CONFIDENTIALITY NOTICE
> The information contained in this email is confidential and may also be 
> privileged. It is intended to be for the exclusive use of the 
> addressee(s) and access to it by any other person is unauthorised. If 
> you are not the addressee please note that you must not distribute, 
> copy, circulate or in any other way use or rely on the information 
> contained in this email. If you have received this email in error please 
> notify us by phone (+44 (0)20 7832 9000) and then destroy the email and 
> any copies of it.
> ------------------------------------------------------------------------

Re: Help with Log4j

Posted by en...@nmg.upc.es.
You could check that log4j is in the AXISCLASSPATH. 
-Enric

On Tue, 27 Jul 2004, Keir Bowden wrote:

> Hi,
>  
> I'm having trouble getting log4j to work in conjunction with commons
> logging, Axis 1.0 and Tomcat 5.0.19.  I've tried altering the
> log4j.properties in the axis.jar file, adding the log4j jar file to the
> tomcat shared\lib, common\lib and server\lib directories, adding
> log4j.properties files in the tomcat shared\classes, common\classes,
> server\classes and the axis\WEB-INF\classes directories, all to no avail.
>  
> I've googled on this with all combinations of tomcat, axis and log4j that I
> can think of, but I just can't seem to coax anything other than the INFO
> level debugging into the tomcat\logs\stdout.log file that I had upon first
> installation of tomcat. 
>  
> I'm using the LogFactory.getLog() method from commons logging, which should
> choose log4j if possible.  However, when I output the Log object that is
> returned, it's an org.apache.commons.logging.impl.Jdk14Logger.
>  
> I've been banging my head against this one for three days now - has anyone
> out there managed to get this combination working?   Any and all tips
> gratefully received.
> 
> Keir Bowden
> Development Consultant
> 
> Telerate 
> Winchmore House, 
> 15 Fetter Lane, London EC4A 1BW 
> (w) +44 (0) 207 832 9839 
>  (e) keir.bowden@emea.telerate.com 
> http://www.telerate.com <http://www.telerate.com/> 
> "Our company name has changed to Telerate. Please note my email address is
> keir.bowden@emea.telerate.com."
> 
>  
> 
> #####################################################################
>                            CONFIDENTIALITY NOTICE
> The information contained in this email is confidential and may also 
> be privileged. It is intended to be for the exclusive use of the 
> addressee(s) and access to it by any other person is unauthorised.
> If you are not the addressee please note that you must not distribute,
> copy, circulate or in any other way use or rely on the information 
> contained in this email.  If you have received this email in error 
> please notify us by phone (+44 (0)20 7832 9000) and then destroy the 
> email and any copies of it.
> ######################################################################
>