title: Use different log4j config files for same application running different process
body: <p>I have developed a simple spring based application which has three different class containing <code>main</code> method. </p>
  
  <pre><code>class P1 -&gt; runs process P1
  class P2 -&gt; runs process P2
  class P3 -&gt; runs process P3
  </code></pre>
  
  <p>Currently these processes use single log configuration file i.e. <code>log4.xml</code>, which is loaded from classpath by default. </p>
  
  <p>I want to do it like this</p>
  
  <pre><code>class P1 -&gt; runs process P1 -&gt; Uses log4j_p1.xml
  class P2 -&gt; runs process P2 -&gt; Uses log4j_p2.xml
  class P3 -&gt; runs process P3 -&gt; Uses log4j_p3.xml
  </code></pre>
  
  <p>How can I achieve this in Spring ? </p>
  
  <p>Note: It is plain Spring application. I am a newbie to Spring. If there is a Spring specific way using <code>Dependency Injection</code> , please do let me know.
  If there is not, how can we achieve it in plain <code>JAVA + log4j</code> way.</p>