log4j problems with Ant
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Neil_Matatall
Posted On:   Wednesday, February 21, 2007 05:42 PM

I recently asked the following question on the Java Dev forum: I have developed an app using Eclipse that uses log4j and everything seems to work fine. But when I copy the code to our Unix box and run it with Ant (just upgraded to 1.7 if that makes a difference), all the logging gets redirected to stdout. It WAS working at some point, but now I can't seem to get it to work correctly and I think it has something to do with the location of my log4j.properties file. Where does this darn thing go? I jar the project if that makes any difference. Should it go in the same directory as the Main class? same dir as the base dir? current dir? Inside the jar? outside? etc... The ruling school of thought, is that it does   More>>

I recently asked the following question on the Java Dev forum:




I have developed an app using Eclipse that uses log4j and everything seems to work fine. But when I copy the code to our Unix box and run it with Ant (just upgraded to 1.7 if that makes a difference), all the logging gets redirected to stdout. It WAS working at some point, but now I can't seem to get it to work correctly and I think it has something to do with the location of my log4j.properties file. Where does this darn thing go? I jar the project if that makes any difference.



Should it go in the same directory as the Main class? same dir as the base dir? current dir? Inside the jar? outside? etc...


The ruling school of thought, is that it doesn't matter as long as log4j.properties is in my classpath. I have tried putting it in my classpath many different ways, but no luck.



			
Here's the relevant part of my build file



















   <<Less
About | Sitemap | Contact