On 29/09/10 00:12, Alex Kozlov wrote:
Hi Leo,

What distribution are you using?  Sometimes the log4j.properties is packed
inside .jar file, which is picked first, so you need to explicitly give a
java option '-Dlog4j.configuration=<path-to-your-log4j-file>' in the
corresponding daemon flags.


You find the JAR which has it in Ant, using the <whichresource> task. Indeed, that was why we wrote it.

Here's a snippet from one of my buildfiles, tests.run.classpath is the classpath to run tests that is set up elsewhere

  <target name="find-log4j" depends="ready-to-test"
      description="find log4j property files in the classpath">
    <whichresource resource="/log4j.properties"
        classpathref="tests.run.classpath"
        property="log4j.test.url" />
    <echo>
      Log4J on the test classpath: ${log4j.test.url}
    </echo>

  </target>

Reply via email to