logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Apvrille, Axelle" <Apv...@europe.stortek.com>
Subject log4j: ERROR No appenders could be found for category...
Date Fri, 08 Jun 2001 16:33:09 GMT

I'm sorry I have to ask this question again, but I haven't seen the exact
answer to my problem or understood the answers... (?)

I've got the following complaints from log4j :
log4j:ERROR No appenders could be found for category
log4j:ERROR Please initialize the log4j system properly.

I've read from the "troubleshooting guide" this is because there's no
appenders attached to my category or its ancestors. But I've done that ! My
configuration file is : 

[..Definition of MyFileAppender and MyConsoleAppender...]
log4j.category.worm=DEBUG,MyFileAppender, MyConsoleAppender

Isn't that last line attach worm category to my appenders ? If worm is an
ancestor of worm.gui.TimestampGUI, this should be okay ? 

Other maybe useful information :
I'm passing my configuration file to the program through a system property :
java ... -Dlog4j.conf.file="log.properties" worm.gui.TimestampGUI

Then, in my application, I've got :
package worm.gui;
import org.apache.log4j.Category;
import org.apache.log4j.PropertyConfigurator;
public class TimestampGUI {
	static Category cat =
	public static void main(String args[]){
	  cat.debug("--> main()");

	  try {
	    // setting up trace file
	    cat.info("Trace controller starts.");
	  catch(NullPointerException exp){
	    // no logging configuration file has been specified
	    // we disable logging

Thanks for any explanation, I haven't understood other answers... 


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

View raw message