title: Log4J: Strategies for creating Logger instances
body: <p>I decided to use Log4J logging framework for a new Java project. 
  I am wondering what strategy should I use for creating/managing Logger instances and why?</p>
  
  <ul>
  <li><p>one instance of Logger per class
  e.g.</p>
  
  <pre><code>class Foo {
      private static final Logger log = Logger.getLogger(Foo.class);
  }
  </code></pre></li>
  <li>one instance of Logger per thread</li>
  <li>one instance of Logger per application</li>
  <li>horizontal slicing : one instance of Logger in each layer of an application (e.g. the view layer, the controller layer and the persistence layer)</li>
  <li>vertical slicing : one instance of Logger within functional partitions of the application </li>
  </ul>
  
  <p>Note: This issue is already considered to some extent in these articles:</p>
  
  <p><a href="https://stackoverflow.com/questions/771675/whats-the-overhead-of-creating-a-log4j-logger">Whats the overhead of creating a Log4j Logger</a></p>