title: Log4j in Unit Testing Environment
body: <p>I am performing JUnit Testing and receiving log4j:WARN No appenders could be found for logger (class .. ) error when I run test class(s).</p>
  
  <p>Log4j properties file is present inside my folder root directory.
  This code seems to work but why doesn't log4j picked up automatically.</p>
  
  <pre class="lang-java prettyprint-override"><code>package com.folio3.automation;
  import org.apache.log4j.BasicConfigurator;
  import org.apache.log4j.Logger;
  import org.junit.Test;
  import junit.framework.Assert;
  
  public class TestClass {
  
      static {
          BasicConfigurator.configure();
      }
  
      private static final Logger LOG = Logger.getLogger(TestClass.class);
  
      @Test
      public void test1(){
          LOG.info("test 1 called ");
          Assert.assertEquals(true, false);
  
  
      }
  
  }
  </code></pre>
  
  <p>Do I have to call BasicConfigurator.configure(); in every class or Base class ?
  Is there any way to achieve?</p>