File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes Configuring Log4J in ANT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Configuring Log4J in ANT" Watch "Configuring Log4J in ANT" New topic
Author

Configuring Log4J in ANT

kartik krishnan
Ranch Hand

Joined: Nov 19, 2006
Posts: 63
Hi,

I am trying to run some unit tests in Ant. Some of the classes require access to log4j's Logger. When I try to run the unit tests, I get the following message



How do I configure log4j.xml in my ant classpath? I have tried setting path refid to the classpath node but nothing seems to be working.

Any suggestion would be appreciated.

Thanks,

Kartik

Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

You should be able to add a folder to the CLASSPATH and have the log4j.xml file in that folder.


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
kartik krishnan
Ranch Hand

Joined: Nov 19, 2006
Posts: 63
Hi,

I tried your suggestion. My code compiles, but my log4j appenders are still not recognized. Can you help?

Console output.



Ant file



My log4j.xml

Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Is that the only class that is failing to log?
kartik krishnan
Ranch Hand

Joined: Nov 19, 2006
Posts: 63
@Martin thanks for replying.

Actually none of my appenders are recognized. I posted a sample from my log4j xml file as the problem is reproduced for all log settings. I could post my extended log file if you prefer.
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Sorry I can't see what the problem could be , anyone else?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Configuring Log4J in ANT