logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dimitri Pissarenko <dimitri.pissare...@gmx.net>
Subject Configuration error
Date Wed, 12 Nov 2003 15:22:43 GMT
Hello!

I'm getting the log4j error message

<error-message>
log4j:WARN No appenders could be found for logger (SomeClass).
log4j:WARN Please initialize the log4j system properly.
</error-message>

This happens in a test case, which has the following main function:

<code-snippet>
import junit.framework.TestSuite;

public class SomeTestSuite extends TestSuite {
	
	...
	public static void main(String[] args) {
	ConsoleAppender consoleAppender=null;
	
	consoleAppender=new ConsoleAppender();
	BasicConfigurator.configure();
	Logger.getRootLogger().addAppender(consoleAppender);

Logger.getLogger(SomeClass.class).addAppender(consoleAppender);
	
	junit.swingui.TestRunner.run(SomeTestSuite.class);
	}
	...
}
</code-snippet>

Why does this error occur despite that fact that I explicitly add 
an appender to the Logger of SomeClass?

How can solve this problem?

TIA

Dimitri Pissarenko

PS: I'm using log4j 1.2.8


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


Mime
View raw message