title: SLF4J, To avoid writing LoggerFactory.getLogger(MyClassName.class) every time
body: <p>I am writing a web application in Java and using SLF4J for logging.</p>
  
  <p>I'm becoming tired of writing the below line for every class that uses logging:</p>
  
  <pre class="lang-java prettyprint-override"><code>private static final Logger logger = LoggerFactory.getLogger(ThisClassName.class);
  </code></pre>
  
  <p>To avoid redundant codes, I am thinking something like</p>
  
  <pre class="lang-java prettyprint-override"><code>interface Loggable {
      Logger logger();
  }
  </code></pre>
  
  <p>and each class can just implement this interface then some magic like AOP inserts the <code>LoggerFactory</code> part.</p>
  
  <p>Has anyone implemented this or knows how to achieve this?</p>
  
  <p>Thanks! </p>