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

Reply via email to