This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I'm using log4j in a web-app. In WSADIE, it is composed of a java project, an EJB project and a web project. In all three I have a log4j.properties file in the classpath.
I had assumed (incorrectly apparently) that the settings would be choosen by the "highest" project being actively run. That is, if I was just running some JUnit testcases against the Java project, Log4j would use its own log4j.properties file. The next level up I thought would be the EJB project and then the Web project that uses both of them. So I was expecting that when I ran the web project on WAS that log4j would pick up on the log4j.properties file in the WEB-INF/classes folder...
Apparently I was wrong and the EJB project ranks higher cause thats the one it picks up on.
I was just wondering if anyone could more accurately explain how log4j determines which file it uses?