Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it possible to make log4j display which file it used to configure itself?
    text
    copied!<p><strong>Question</strong></p> <p>Is it possible to make Log4J display the full path of the file it used for configuration? <hr> <strong>Background</strong></p> <p>I have a love-hate relationship with log4j. In good times, it's great but when it's not working, it can be one of the most difficult things to debug. I manage all the logging in our application. As such, I'm very familiar with logging and the <a href="http://logging.apache.org/log4j/1.2/manual.html" rel="noreferrer">default initialization procedure defined in the manual.</a> Still, it seems that, every few weeks, logging breaks and I spend <strong>a lot</strong> of time sorting out the problem.</p> <p>This time, it's severely broken. Every single log statement everywhere is being dumped to the console and I can't figure out why. The same exact code base that used my log4j.xml files last week, is suddenly using some other configuration. Nothing obvious has changed. My only guess is, a few dependencies have changed and I suspect Maven has downloaded some evil JAR that's breaking everything.</p> <p>If I could just figure out <strong><em>which configuration file Log4J decided to use at startup</em></strong>, I could tackle this and most other problems easily.<br> <hr> <strong>Summary</strong></p> <p>Is there some way to tell Log4J to print which file it used for configuration? Alternatively, is there a way to break a running application and use the debugger to answer this question (maybe with an expression or by inspecting variables)?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload