ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: Ant JUnit task and Log4j question...
Date Wed, 18 Sep 2002 23:53:29 GMT

Anyone have any info about this?  I've gotten no response.

Jake

At 11:18 AM 9/18/2002 -0500, you wrote:
>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:ant-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message