title: When is it necessary to call DOMConfigurator.configure to read a log4j.xml file?
body: <p>I am learning how to use <strong>log4j</strong> (with <strong>slf4j</strong>) in a Java project. Some web pages I have read say to call <code>DOMConfigurator.configure("log4j.xml")</code> to incorporate the settings in the <code>log4j.xml</code> file into a <code>Logger</code> you have created. </p>
  
  <p>I have also seen plenty of code examples where a <code>log4j.xml</code> file and some Java code are presented, and the Java code does not call <code>DOMConfigurator.configure</code>. The descriptions around the code samples imply that the <code>log4j.xml</code> settings are getting picked up by the logger. </p>
  
  <p>In my project, if I don't call <code>DOMConfigurator.configure</code>, the <code>log4j.xml</code> file is not read. Are there conventions for when a <code>log4j.xml</code> file will be found when <code>getLogger</code> is called, and loading the file explicitly with <code>DOMConfigurator.configure</code> is not necessary?</p>