Question
Is it possible for Log4J to display the full path to the file that it used to configure?
BackgroundI have a love-hate relationship with log4j. This is great in good times, but when it doesn't work, it can be one of the most difficult things to debug. I manage all the inputs to our application. Thus, I am very familiar with the logging and default initialization procedure defined in the manual. However, it seems that every few weeks the registration is interrupted, and I spend a lot of time sorting the problem.
This time it is badly broken. Each log statement is always reset to the console, and I cannot understand why. The same exact code base that used my log4j.xml files last week suddenly uses a different configuration. Nothing obvious has changed. My only assumption: several dependencies have changed, and I suspect that Maven has loaded some kind of evil JAR that crashed everything.
If I could just determine which Log4J configuration file I decided to use at startup , I could easily solve this and most other problems.
SummaryIs it possible to specify Log4J to print the file that it used to configure? Alternatively, is there a way to break a running application and use a debugger to answer this question (perhaps with an expression or by checking variables)?
java log4j
gMale Sep 20 '10 at 15:26 2010-09-20 15:26
source share