Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Configuring Log4J in ANT

 
kartik krishnan
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should be able to add a folder to the CLASSPATH and have the log4j.xml file in that folder.
 
kartik krishnan
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is that the only class that is failing to log?
 
kartik krishnan
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry I can't see what the problem could be , anyone else?
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic