Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ant: Logging via Log4j

Tags:

log4j

ant

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:

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?

like image 630
Dmitry Avatar asked Nov 13 '22 20:11

Dmitry


1 Answers

Well, I found a solution. The problem was in log4j.jar. This file was corrupted. I have changed it and everithing is working now.

like image 110
Dmitry Avatar answered Dec 19 '22 03:12

Dmitry