Ant: Logging via Log4j
My issue is to make ant logging in the way I need. So that I decided to use Log4j. As I has read from this article I set the ANT_OPTS开发者_JAVA百科:
set ANT_OPTS=-Dlog4j.debug -Dlog4j.configuration=file:///d:/ant_dir/lib/log4j.xml
When I try to execute the build.xml by the command:
D:/ant_dir>ant -listener org.apache.tools.ant.listener.Log4jListener
I catch an error: Class org.apache.tools.ant.listener.Log4jListener could not be loaded because of an invalid dependency. The log4j.jar and log4j.xml are located in the ANT_HOME/lib directory.
I have been searching for a tutorial but found nothing. Can somebody, please, help me with an advice or give a useful link?
Well, I found a solution. The problem was in log4j.jar. This file was corrupted. I have changed it and everithing is working now.
精彩评论