title: Is Log4j isDebugEnabled() necessary before using logger.debug()?
body: <p>When I was going through some code, I noticed the use of logger as follows,   </p>
  
  <pre><code>if(logger.isDebugEnabled())   
      logger.debug("Something..");
  </code></pre>
  
  <p>But in some codes, I observed like this.</p>
  
  <pre><code>logger.debug("Something..");
  </code></pre>
  
  <p>When I looked at the source of log4j, in the <code>debug()</code> method of Logger itself  <code>if(logger.isDebugEnabled())</code> was checked. Then why do we need this unnecessary overhead <code>if(logger.isDebugEnabled())</code>??</p>