title: log4j - Configuring logger name
body: <p>I've been using <a href="http://logging.apache.org/log4j/" rel="nofollow">log4j</a> for some time. One thing I've never really understood is why they recommend configuring the logger name from the class. Specifically, I wonder:</p>
  
  <ol>
  <li>What is the difference the three logger declarations? </li>
  <li>Which is better and why?</li>
  <li>Is there a method that allows copy and paste log declaration without having to type the name of the class somewhere? I'd prefer something that didn't use reflection for performance sake.</li>
  </ol>
  
  <p>For example, consider class <code>MyClass</code>.  Three declarations I've run across are:</p>
  
  <ul>
  <li><p><code>final Logger myLogger = LogManager.getLogger(MyClass.class.getName());</code></p></li>
  <li><p><code>final Logger myLogger = LogManager.getLogger(MyClass.class);</code></p></li>
  <li><p><code>final Logger myLogger = LogManager.getLogger("MyClass");</code></p></li>
  </ul>
  
  <p>I have read the doc, and I see references to the first and second forms on on the log4j site, but I don't understand what the advantage is.</p>