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:[EMAIL PROTECTED]]
> 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:[EMAIL PROTECTED]]
> >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" <[EMAIL PROTECTED]>
> >To: "Tomcat Users List" <[EMAIL PROTECTED]>
> >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" <[EMAIL PROTECTED]>
> >> To: <[EMAIL PROTECTED]>
> >> 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: 
> [EMAIL PROTECTED]
> >> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >> >
> >>
> >>
> >> 
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: 
> [EMAIL PROTECTED]
> >>
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to