Thanks Ceki, I had tried that and then went down into the code to try to
specify the configuration ergo my previous message. So I tried the the
automatic configuration (with a couple of print statements in both
ProjectTestSuite and Abbreviation to make sure the system property was
available) and ProjectTestSuite found the property and configured correctly,
yet the lower class still 'yacked'.


E:\working\aviation>java -cp
./classes;./bin/junit3.7/junit.jar;./bin/jakarta-log4j-1.2.8/dist/lib/log4j-
1.2.8.jar -Dlog4j.configura
tion=file:/e:/working/aviation/log4j.properties
com.growlingcow.ProjectTestSuite
log4j.configuration[ProjectTestSuite]
file:/e:/working/aviation/log4j.properties
(ProjectTestSuite.java:45) INFO  com.growlingcow.ProjectTestSuite  - In main
method for class com.growlingcow.ProjectTestSuite
log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to
a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
log4j:ERROR [EMAIL PROTECTED] whereas object of type
log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by
[EMAIL PROTECTED]
log4j:ERROR Could not instantiate appender named "A1".
log4j:WARN No appenders could be found for logger
(com.growlingcow.aviation.cfs.data.Abbreviation).
log4j:WARN Please initialize the log4j system properly.
log4j.configuration [Abbrev] file:/e:/working/aviation/log4j.properties
log4j.configuration [Abbrev] file:/e:/working/aviation/log4j.properties
data/Abbreviations.dat
data/NOTAMAbbreviations.dat
fake Key

E:\working\aviation>

where the properties file reads


# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=DEBUG, A1
#Set logger for abbreviation - make it the same as root
log4j.logger.com.growlingcow.aviation.cfs.data.Abbreviation=DEBUG,A1

# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender

# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout

#log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
log4j.appender.A1.layout.ConversionPattern=(%F:%L) %-5p %c %x - %m%n


Any ideas?

Thanks!!!

Cam



-----Original Message-----
From: Ceki G�lc� [mailto:[EMAIL PROTECTED]
Sent: March 10, 2004 11:34 AM
To: Log4J Users List
Subject: Re: JUnit and log4j


Cameron,

I recommend that you use the automatic configuration feature of log4j. That
should solve the configuration issues you are experiencing. As for log
entries appearing multiple times, read the appender additivity section of
the manual.

HTH,

At 11:02 AM 3/10/2004 -0700, Cameron Roe wrote:
>Does anyone run log4j with JUnit out
>there???????????????????????????????????????????????????
>Please let me know how!
>
>
>Cheers

--
Ceki G�lc�

      For log4j documentation consider "The complete log4j manual"
      ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to