tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Collins, Jim" <jim.coll...@uk.nomura.com>
Subject RE: Log4J and tomcat using Commons logging
Date Mon, 17 Feb 2003 09:07:50 GMT
Hi Larry,

In my myapp/WEB-INF/lib I have:

log4j-1.2.6.jar

In myapp/WEB-INF/classes I have:

log4j.properties 

In common/lib I have:

commons-logging-api.jar
commons-logging.jar
log4j-1.2.6.jar

And in server/lib I have no logging files.

I intend to use log4j anyway so it is not a major problem if I use it
directly rather than through commons-logging. It would however be nice to be
able to chop and change the underlying logging implementation without having
to change my code.

Regards

Jim.

> -----Original Message-----
> From: Larry Meadors [mailto:larry.meadors@plumcreek.com]
> Sent: 14 February 2003 18:14
> To: tomcat-user@jakarta.apache.org
> Subject: RE: Log4J and tomcat using Commons logging
> 
> 
> Hey Jim, 
> 
> Can you help me understand your configuration so I can help identify
> where the breakdown is? I am most curious about where all the 
> jar files
> are - common/lib, shared/lib, or WEB-INF/lib? Probably the best info
> would be directory listings of common/lib, shared/lib, and 
> WEB-INF/lib.
> 
> I suspect that log4j is being loaded to far up the classloader tree to
> be able to find your configuration file when used through
> commons-logging, but when you use it directly, it is loaded again by
> another classloader that is able to find your configuration file. That
> is why I was asking if there was a way to tell log4j to use the
> properties file without relying on the class loader. I do not 
> use log4j,
> so I do not know what it can do.
> 
> Larry
> 
> >>> jim.collins@uk.nomura.com 02/14/03 10:38 AM >>>
> Hi Larry,
> 
> I am not having a problem with log4j I deploy the log4j.properties to
> myapp/WEB-INF/classes and it works fine. I would not want to have
> log4j.properies in common/classes because I want to be able 
> to configure
> my
> logging for individaul apps. The problem is if I use commons-logging,
> this
> SHOULD use the underlying log4j implementation and the 
> log4j.properties
> file
> that I have deployed with my app. With commons-logging you do 
> not log to
> any
> particular logging implementation.
> 
> Regards
> 
> Jim.
> 
> > -----Original Message-----
> > From: Larry Meadors [mailto:larry.meadors@plumcreek.com]
> > Sent: 14 February 2003 17:11
> > To: tomcat-user@jakarta.apache.org
> > Subject: RE: Log4J and tomcat using Commons logging
> > 
> > 
> > I have never used log4j, but you might try putting the 
> > log4j.properties
> > file in common/classes, it means all apps get the same log 
> > settings, but
> > may work. :-/
> > 
> > Is there a way to tell log4j to use the properties file 
> > without relying
> > on the class loader, like an environment variable or something? That
> > might make it easier to use.
> > 
> > Larry
> > 
> > >>> jim.collins@uk.nomura.com 02/14/03 09:55 AM >>>
> > Hi Larry,
> > 
> > There have been some problems with the location of the 
> commons-logging
> > jar
> > file. It was in server/lib but this causes intermittent 
> problems that
> > causes
> > Tomcat to crash. I have posted this problem to this mail 
> list and the
> > same
> > problem has been published on other mail lists. The fix is to move
> > commons-logging.jar from server/lib to common/lib and not to deploy
> > commons-logging with your webapp. At the moment I have
> > commons-logging.jar
> > only in common/lib and the log4j jar file in common/lib and my apps
> > WEB-INF/lib dir. If I log directly to log4j it uses my 
> > log4j.properties
> > file
> > but if I use commons-logging it uses the default.
> > 
> > For the moment I will stick to calling log4j directly. It 
> > would be nice
> > to
> > clear this up though as a lot of other people are having the same
> > problem
> > trying to use commons-logging.
> > 
> > Regards
> > 
> > Jim.
> > 
> > > -----Original Message-----
> > > From: Larry Meadors [mailto:larry.meadors@plumcreek.com]
> > > Sent: 14 February 2003 15:40
> > > To: tomcat-user@jakarta.apache.org
> > > Subject: RE: Log4J and tomcat using Commons logging
> > > 
> > > 
> > > Where are your commons-logging and log4j jars?
> > > 
> > > If they are loaded by a different classloader than the 
> > > log4j.properties
> > > file, it may not work.
> > > 
> > > Larry
> > > 
> > > >>> jim.collins@uk.nomura.com 02/14/03 02:47 AM >>>
> > > Hi,
> > > 
> > > I have managed to get log4j to work for my webapps. I just have a
> > > log4j.properties file in WEB-INF/classes and it works. I can't get
> > > commons-logging to work though. If I try commons-logging 
> it does not
> > > pick up
> > > my log4j.properties file yet using log4j directly does pick 
> > > up the file.
> > > 
> > > I have spent a lot of time trawling Tomcat/Struts/Commons 
> > > mail archives
> > > to
> > > try and find how to get this to work to no avail. Reading 
> these mail
> > > archives I can see that a lot of other people are having the same
> > > problem as
> > > me.
> > > 
> > > As Tomcat and Struts uses commons-logging could someone 
> > please try and
> > > clarify how we set up a webapp to use commons-logging with its own
> > > configuration file. I am sure this would prove useful to a 
> > > large number
> > > of
> > > users.
> > > 
> > > Many thanks
> > > 
> > > Jim.
> > > 
> > > > -----Original Message-----
> > > > From: Shapira, Yoav [mailto:yoav.shapira@mpi.com]
> > > > Sent: 13 February 2003 18:11
> > > > To: Tomcat Users List
> > > > Subject: RE: Log4J and tomcat
> > > > 
> > > > 
> > > > 
> > > > Howdy,
> > > > FYI: we deploy in packed .war files (and have 
> > > > unpackWARs="false" in the
> > > > <Host> elements of server.xml).  We use log4j with a properties
> > > > configuration file.  The way we configure log4j is in a servlet
> > > > listener's contextInitialized(ServletContext sce) method, using 
> > > > URL configurationFileUrl =
> > > > 
> sce.getServletContext().getResource("/WEB-INF/config/log4j.prop");
> > > > PropertyConfigurator.configure(configurationFileUrl);
> > > > 
> > > > This works from wars, unpacked wars, etc.
> > > > 
> > > > Yoav Shapira
> > > > Millennium ChemInformatics
> > > > 
> > > > 
> > > > >-----Original Message-----
> > > > >From: Sloan Seaman [mailto:sloan@sgi.net]
> > > > >Sent: Thursday, February 13, 2003 1:03 PM
> > > > >To: Tomcat Users List
> > > > >Subject: Re: Log4J and tomcat
> > > > >
> > > > >I'll keep you posted if I ever figure something out.
> > > > >
> > > > >The problem prob. is that since the common-logging and log4j 
> > > > use a lot
> > > > of
> > > > >static objects I'm getting what tomcat has already set up 
> > > (this is a
> > > > theory
> > > > >mind you)....
> > > > >
> > > > >----- Original Message -----
> > > > >From: "tomcat guy" <tomcat@corridortechnology.com>
> > > > >To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
> > > > >Sent: Thursday, February 13, 2003 12:57 PM
> > > > >Subject: Re: Log4J and tomcat
> > > > >
> > > > >
> > > > >> Sloan, sorry can't help you out but if you find a 
> > solution I'd be
> > > > >interested
> > > > >> in how you came up with the fix... Learnin about log4j it 
> > > > could help
> > > > in
> > > > >the
> > > > >> future....
> > > > >>
> > > > >> ----- Original Message -----
> > > > >> From: "Sloan Seaman" <sloan@sgi.net>
> > > > >> To: <tomcat-user@jakarta.apache.org>
> > > > >> Sent: Wednesday, February 12, 2003 3:23 PM
> > > > >> Subject: Log4J and tomcat
> > > > >>
> > > > >>
> > > > >> > I'm deploying a war file using tomcat and I wish to 
> > > use Apache's
> > > > common
> > > > >> > logging api to log things (log4j behind the scenes).
> > > > >> >
> > > > >> > For some reason my configuration file seems to be 
> > > getting ignored
> > > > but
> > > > >my
> > > > >> > log.info msgs are showing up in the console window 
> > for Tomcat.
> > > > >> >
> > > > >> > Can someone tell me why this is happening?
> > > > >> >
> > > > >> > How do I get my app to use my log4j conf file?
> > > > >> >
> > > > >> > Thanks!
> > > > >> > --
> > > > >> > Sloan
> > > > >> >
> > > > >> >
> > > > >> >
> > > > >> >
> > > > 
> > > 
> > 
> ---------------------------------------------------------------------
> > > > >> > To unsubscribe, e-mail: 
> > > > tomcat-user-unsubscribe@jakarta.apache.org
> > > > >> > For additional commands, e-mail:
> > > > tomcat-user-help@jakarta.apache.org
> > > > >> >
> > > > >>
> > > > >>
> > > > >> 
> > > > 
> > > 
> > 
> ---------------------------------------------------------------------
> > > > >> To unsubscribe, e-mail: 
> > > tomcat-user-unsubscribe@jakarta.apache.org
> > > > >> For additional commands, e-mail: 
> > > > tomcat-user-help@jakarta.apache.org
> > > > >>
> > > > >>
> > > > >
> > > > >
> > > > 
> > > 
> > 
> >---------------------------------------------------------------------
> > > > >To unsubscribe, e-mail: 
> > tomcat-user-unsubscribe@jakarta.apache.org
> > > > >For additional commands, e-mail: 
> > > tomcat-user-help@jakarta.apache.org
> > > > 
> > > > 
> > > > 
> > > > 
> > > > This e-mail, including any attachments, is a confidential 
> > > > business communication, and may contain information that is 
> > > > confidential, proprietary and/or privileged.  This e-mail is 
> > > > intended only for the individual(s) to whom it is addressed, 
> > > > and may not be saved, copied, printed, disclosed or used by 
> > > > anyone else.  If you are not the(an) intended recipient, 
> > > > please immediately delete this e-mail from your computer 
> > > > system and notify the sender.  Thank you.
> > > > 
> > > > 
> > > > 
> > > 
> > 
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: 
> tomcat-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: 
> > tomcat-user-help@jakarta.apache.org
> > > > 
> > > 
> > > 
> > > PLEASE READ: The information contained in this email is 
> confidential
> > > and intended for the named recipient(s) only. If you are not 
> > > an intended
> > > recipient of this email you must not copy, distribute or take any 
> > > further action in reliance on it and you should delete it and 
> > > notify the
> > > sender immediately. Email is not a secure method of 
> > communication and 
> > > Nomura International plc cannot accept responsibility for 
> > the accuracy
> > > or completeness of this message or any attachment(s). 
> Please examine
> > > this
> > > email for virus infection, for which Nomura International 
> > plc accepts
> > > no responsibility. If verification of this email is sought 
> > then please
> > > request a hard copy. Unless otherwise stated any views or opinions
> > > presented are solely those of the author and do not 
> > represent those of
> > > Nomura International plc. This email is intended for informational
> > > purposes only and is not a solicitation or offer to buy or sell
> > > securities or related financial instruments. Nomura 
> > > International plc is
> > > regulated by the Financial Services Authority and is a 
> member of the
> > > London Stock Exchange.
> > > 
> > > 
> > > 
> > > 
> > 
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: 
> tomcat-user-help@jakarta.apache.org
> > > 
> > > 
> > > 
> > > 
> > 
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: 
> tomcat-user-help@jakarta.apache.org
> > > 
> > 
> > 
> > PLEASE READ: The information contained in this email is confidential
> > and intended for the named recipient(s) only. If you are not 
> > an intended
> > recipient of this email you must not copy, distribute or take any 
> > further action in reliance on it and you should delete it and 
> > notify the
> > sender immediately. Email is not a secure method of 
> communication and 
> > Nomura International plc cannot accept responsibility for 
> the accuracy
> > or completeness of this message or any attachment(s). Please examine
> > this
> > email for virus infection, for which Nomura International 
> plc accepts
> > no responsibility. If verification of this email is sought 
> then please
> > request a hard copy. Unless otherwise stated any views or opinions
> > presented are solely those of the author and do not 
> represent those of
> > Nomura International plc. This email is intended for informational
> > purposes only and is not a solicitation or offer to buy or sell
> > securities or related financial instruments. Nomura 
> > International plc is
> > regulated by the Financial Services Authority and is a member of the
> > London Stock Exchange.
> > 
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > 
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > 
> 
> 
> PLEASE READ: The information contained in this email is confidential
> and intended for the named recipient(s) only. If you are not 
> an intended
> recipient of this email you must not copy, distribute or take any 
> further action in reliance on it and you should delete it and 
> notify the
> sender immediately. Email is not a secure method of communication and 
> Nomura International plc cannot accept responsibility for the accuracy
> or completeness of this message or any attachment(s). Please examine
> this
> email for virus infection, for which Nomura International plc accepts
> no responsibility. If verification of this email is sought then please
> request a hard copy. Unless otherwise stated any views or opinions
> presented are solely those of the author and do not represent those of
> Nomura International plc. This email is intended for informational
> purposes only and is not a solicitation or offer to buy or sell
> securities or related financial instruments. Nomura 
> International plc is
> regulated by the Financial Services Authority and is a member of the
> London Stock Exchange.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 


PLEASE READ: The information contained in this email is confidential
and intended for the named recipient(s) only. If you are not an intended
recipient of this email you must not copy, distribute or take any 
further action in reliance on it and you should delete it and notify the
sender immediately. Email is not a secure method of communication and 
Nomura International plc cannot accept responsibility for the accuracy
or completeness of this message or any attachment(s). Please examine this
email for virus infection, for which Nomura International plc accepts
no responsibility. If verification of this email is sought then please
request a hard copy. Unless otherwise stated any views or opinions
presented are solely those of the author and do not represent those of
Nomura International plc. This email is intended for informational
purposes only and is not a solicitation or offer to buy or sell
securities or related financial instruments. Nomura International plc is
regulated by the Financial Services Authority and is a member of the
London Stock Exchange.



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


Mime
View raw message