title: Java Logging With Abstract Classes
body: <p>I am working on a project, and am currently working on implementing some logging with log4j and I was curious about how I should go about implementing the logs. The two implementations I am kicking around are as follows:</p>
  
  <p><strong>First Option</strong> </p>
  
  <p>Use single log from super class for that class and all sub classes:</p>
  
  <pre><code>public abstract class AbstractFoo {
      protected static Log LOG = LogFactory.getLog(AbstractFoo.class);
  
      ...
  }
  
  public class Foo extends AbstractFoo {
      public void someMethod() {
          LOG.info("Using abstract log");
      }
  }
  </code></pre>
  
  <p><strong>Second Option</strong> </p>
  
  <p>Use individual logs for each class, super and subs:</p>
  
  <pre><code>public abstract class AbstractFoo {
      private static Log LOG = LogFactory.getLog(AbstractFoo.class);
  
      ...
  }
  
  public class Foo extends AbstractFoo {
      private static Log LOG = LogFactory.getLog(Foo.class);        
  
      public void someMethod() {
          LOG.info("Using own log");
      }
  }
  </code></pre>
  
  <p>What makes more sense and why?</p>