title: How can i load my log4j.xml file which is not in classpath and it present in D drive?
body: <p>I want to configure logging with <code>log4j</code> via xml; which is present in my D drive and <strong>not</strong> on classpath.</p>
  
  <p>I am using Spring MVC.</p>
  
  <p>Below is my <code>log4j.xml</code></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"&gt;
  &lt;log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true"&gt;
  
  &lt;appender name="console" class="org.apache.log4j.ConsoleAppender"&gt;
      &lt;param name="Target" value="System.out" /&gt;
      &lt;layout class="org.apache.log4j.PatternLayout"&gt;
          &lt;param name="ConversionPattern" value="%-5p %c{1} - %m%n" /&gt;
      &lt;/layout&gt;
  &lt;/appender&gt;
  
  &lt;appender name="info-log" class="org.apache.log4j.FileAppender"&gt;
      &lt;param name="File" value="d:/temp/info.log" /&gt;
      &lt;layout class="org.apache.log4j.PatternLayout"&gt;
          &lt;param name="ConversionPattern" value="%-5p %c{1} - %m%n" /&gt;
      &lt;/layout&gt;
      &lt;filter class="org.apache.log4j.varia.LevelRangeFilter"&gt;
          &lt;param name="LevelMin" value="debug" /&gt;
          &lt;param name="LevelMax" value="info" /&gt;
          &lt;param name="AcceptOnMatch" value="true" /&gt;
      &lt;/filter&gt;
  &lt;/appender&gt;
  
  &lt;appender name="error-log" class="org.apache.log4j.FileAppender"&gt;
      &lt;param name="File" value="d:/temp/error.log" /&gt;
      &lt;layout class="org.apache.log4j.PatternLayout"&gt;
          &lt;param name="ConversionPattern" value="%-5p %c{1} - %m%n" /&gt;
      &lt;/layout&gt;
      &lt;filter class="org.apache.log4j.varia.LevelRangeFilter"&gt;
          &lt;param name="LevelMin" value="warn" /&gt;
          &lt;param name="LevelMax" value="fatal" /&gt;
          &lt;param name="AcceptOnMatch" value="true" /&gt;
      &lt;/filter&gt;
  &lt;/appender&gt;
  
  &lt;logger name="com.mvc.login.LoginController"&gt;
      &lt;appender-ref ref="info-log" /&gt;
      &lt;appender-ref ref="error-log" /&gt;
  &lt;/logger&gt;
  
  &lt;root&gt;
      &lt;level value="debug" /&gt;
      &lt;appender-ref ref="console" /&gt;
  &lt;/root&gt;
  </code></pre>