Hi,
I'm using the JUnit task and it seems to be doing something odd. When
it does logging, it seems to reconfigure log4j constantly. The reason
I think this is that I have a FileAppender set up with append="false".
That file gets a bunch of stuff written to it, but then is erased
shorly thereafter. This doesn't happen when the app is running Under
Tomcat. Even when I shut down, the log file stays there until it is
re-initialized upon application restart.
Here's the JUnit config:
<junit
printsummary="yes"
haltonfailure="no"
fork="yes"
dir="${unit.test.dir}" >
<classpath refid="build.test.classpath" />
<sysproperty
key="Barracuda.log.home"
value="${log4j.log.path}" />
<sysproperty
key="log4j.configuration"
value="file:../WEB-INF/log4j.xml" />
<formatter
type="xml"
usefile="yes" />
<batchtest todir="${report.tests}" >
<fileset refid="${batchtest}" />
</batchtest>
</junit>
Here's the Log4j config:
<appender name="A2" class="org.apache.log4j.FileAppender">
<param name="File" value="${Barracuda.log.home}/main.log" />
<param name="Append" value="false" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-4r [%t] %-5p %c %x - %m%n"/>
</layout>
</appender>
Is this expected behavior? Is the only way around it to have
append="true" for the FileAppender?
As a side note, how would one do the following.
I have a system property where I'd like the key to be referenced as
set property. So instead of:
<sysproperty
key="Barracuda.log.home"
value="${log4j.log.path}" />
I'd have:
<sysproperty
key="${log4j.system.variable.name}"
value="${log4j.log.path}" />
Any way I can do that?
Jake
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>