title: LoggerFactory.getLogger(ClassName.class) vs LoggerFactory.getLogger(this.getClass().getName())
body: <p>I'm trying to improve my optimization skills in Java. In order to achieve that, I've got an old program I made and I'm trying my best to make it better. In this program I'm using SL4J for logging. To get the logger I did:</p>
  
  <pre><code>private static final Logger logger = LoggerFactory.getLogger(this.getClass().getName());
  </code></pre>
  
  <p>At the time I wrote the code, I thought this was the best option, because I remove a reference to the class name(which may be refactored). But now I'm not so sure anymore...</p>
  
  <pre><code>private static final Logger logger = LoggerFactory.getLogger(ClassName.class);
  </code></pre>
  
  <p>On the other side, keeps the reference to the class name, but it removes one method call. This may not be a big improvement in performance for one class, but when you have lots of class, this may be something. </p>
  
  <p>So my question is:</p>
  
  <p>Which approach is better? Using the class name or getting it through reflection? </p>
  
  <p>Please, motivate your answer with pro and cons. Thank you.</p>