发现给代码配置了log4j后依然不给输出log…………
查看了一些ant编译后的文件,发现没有没有找到配置文件log4j.properties.
因为在build.xml文件中,compile的时候,并没有把配置文件log4j.properties复制到其对应目录。
所以,复制src\log4j.properties到bin\log4j.properties。
再运行,OK了。
<target name="compile" depends="init" description="编译">
<copy todir="${classes}">
<fileset dir="${src}">
<include name="**/*.properties"/>
</fileset>
</copy>
<javac srcdir="${src}" destdir="${classes}" classpathref="classpath" includeantruntime="no"/>
</target>
原文 :http://www.blogjava.net/zhyiwww/archive/2008/12/19/247297.html