tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pitre, Russell" <RPI...@shawmut.com>
Subject RE: [POLL] Logging
Date Fri, 21 Nov 2003 18:17:09 GMT
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
	
	

Mime
View raw message