logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dyson, Steve" <SDy...@thalesnavigation.com>
Subject Interaction between Log4J and JUnit
Date Thu, 02 Jan 2003 17:23:22 GMT
I am trying to sort out an interaction between Log4J and the JUnit swing
interface. 

I have distilled the problem down into 4 very small source files
(ExamplePrint.java, ExampleLog4J.java, ExamplePrintTest.java and
ExampleLog4Jtest.java), and an xml configuration file. The ExamplePrint is a
simple class with a constructor and a one line method, it calls
System.out.println(). The ExampleLog4J is the equivalent that calls
logger.info() instead. The other files are simple JUnit exercisers.

The following command lines work a expected...
  
   	java  example.ExamplePrint
   	java  example.ExampleLog4J

   	java junit.textui.TestRunner example.ExamplePrintTest
   	java junit.textui.TestRunner example.ExampleLog4JTest

   	java junit.swingui.TestRunner example.ExamplePrintTest

The following line

   	java junit.swingui.TestRunner example.ExampleLog4Jtest

causes the following log4j  error messages

		log4j:ERROR A "org.apache.log4j.xml.DOMConfigurator" object
is not assignable to a "org.apache.log4j.spi.Configurator" variable
		log4j:ERROR The class "org.apache.log4j.spi.Configurator"
was loaded by
		log4j:ERROR [junit.runner.TestCaseClassLoader@cd66ea]
whereas object of type
		log4j:ERROR "org.apache.log4j.xml.DOMConfigurator" was
loaded by [sun.misc.Launcher$AppClassLoader@2f6684].
		log4j:ERROR Could not instantiate configurator
[org.apache.log4j.xml.DOMConfigurator].
		log4j:WARN No appenders could be found for logger
(example.ExampleLog4J).
		log4j:WARN Please initialize the log4j system properly.


Please can anyone let me know what is happening!

Regards (and Happy New Year to all)
Steve.

PS: The source code,  xml and log files are available for inspection if
needed.







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


Mime
View raw message