tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: [POLL] Logging
Date Fri, 21 Nov 2003 19:05:01 GMT

Howdy,
Either call it log4j.properties and not logging.properties so that log4j
can configure itself, or add a / to the getResourceAsStream argument.
Your InputStream is null and the configureAndWatch call doesn't do
anything because the props is empty.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Pitre, Russell [mailto:RPITRE@shawmut.com]
>Sent: Friday, November 21, 2003 1:17 PM
>To: Tomcat Users List
>Subject: RE: [POLL] Logging
>
>Hi Everyone,  thanx for helping me decide to which logging api to
>use............which is log4j.......when i try to use the logger i get
this
>message on the console window...
>
>log4j:WARN No appenders could be found for logger
>(com.pitre.servlet.SetupServlet).
>log4j:WARN Please initialize the log4j system properly.
>
>I have the log4j jar file in my WEB-INF/lib directory and my
>logging.properties file in the classes directory.   I "configured" the
>logger  with the properties file as such...the logging.properties seems
to
>be loading fine......at least it can find the properties file........my
>webapp is deployed by way of ant and a war file....
>
>InputStream in =
>getClass().getClassLoader().getResourceAsStream("logging.properties");
>   props.load(in);
>   String watch = System.getProperty("LOGGING.WATCH");
>   if(watch != null && watch.equalsIgnoreCase("TRUE")){
>    PropertyConfigurator.configureAndWatch(watch);
>    System.out.println("Watch logging.properties every 60 seconds for
>changes");
>   }else{
>    PropertyConfigurator.configure(props);
>    System.out.println("Not watching logging.properties for changes");
>   }
>
>And here is my logging.properties file.....
>
>log4j.rootLogger=debug, R
>log4j.appender.R=org.apache.log4j.ConsoleAppender
>log4j.appender.R.layout=org.apache.log4j.SimpleLayout
>
>
>I'm baffled....
>
>Russ
>
>
>
>
>-----Original Message-----
>From: Adam Hardy [mailto:ahardy.struts@cyberspaceroad.com]
>Sent: Fri 11/21/2003 5:23 AM
>To: Tomcat Users List
>Cc:
>Subject: Re: [POLL] Logging
>
>
>
>	2. Java.util.Logging
>
>	Purely because it's part of the sdk and meets my logging
>requirements. I
>	did use log4j before, but since I decided I should know
>	java.util.logging, I stuck with it after learning how to use it.
>
>	Adam
>
>
---------------------------------------------------------------------
>	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


Mime
View raw message