[slf4j-user] log4j-over-slf4j 1.6.1 and Ant Listener

Scott Dudley scott at telesoft.com
Tue Jul 12 19:08:34 CEST 2011


I've recently been testing our applications on log4j 1.6.1 and also used 
the log4j-over-slf4j bridge.

Everything has worked beautifully thus far with but one exception: one 
of the developers authored some Ant-related code which registers a listener:

Project antProj = new org.apache.tools.ant.Project();
Log4jListener log4jListener = new 
org.apache.tools.ant.listener.Log4jListener();
antProj.addBuildListener(log4jListener);

This results in the following Exception:

java.lang.NoSuchMethodError: 
org.apache.log4j.Logger.getAllAppenders()Ljava/util/Enumeration;
     at 
org.apache.tools.ant.listener.Log4jListener.<init>(Log4jListener.java:51)
     at 
com.telesoft.ant.AntTargetLauncher.executeAntTask(AntTargetLauncher.java:32)
     ...

I stubbed out this method in org/apache/log4j/Category.java and got past 
that hurdle only to encounter the following:

java.lang.NoClassDefFoundError: org/apache/log4j/helpers/NullEnumeration
     at 
org.apache.tools.ant.listener.Log4jListener.<init>(Log4jListener.java:51)
     at 
com.telesoft.ant.AntTargetLauncher.executeAntTask(AntTargetLauncher.java:32)
     ...

How does one replace log4j/Ant integration via slf4j?

Thanks.


-- 
Scott Dudley
Senior Developer

Telesoft Corp. | 1661 E. Camelback Rd., Suite 300 | Phoenix, AZ, 85016

*o:* (602) 308-1115**| *f:* (602) 308-1300 | *w:* www.telesoft.com 
<http://www.telesoft.com>

*TEM Edge Blog <http://www.telesoft.com/blog> *|*Twitter 
<http://www.twitter.com/_Telesoft> *|*Facebook

<http://www.facebook.com/pages/Telesoft-Corp/76397971661>Join us at 
Telesoft Connections 2011. Learn more now! 
<http://www.telesoftconference.com>*

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/slf4j-user/attachments/20110712/3075119e/attachment-0001.html>


More information about the slf4j-user mailing list