ant运行java不能输出log4j日志问题的解决

来源:互联网 发布:电脑网络本地连接红叉 编辑:程序博客网 时间:2024/04/27 22:21

发现给代码配置了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

0 0
原创粉丝点击