When running a Java class through Ant, I was having a lot of trouble getting Log4J output, even though the log4.properties was on the classpath. Documenting it here in case anyone else has the same problem.
E.g.
<java classname="Hello" fork="true">
<classpath>
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</java>