title: What's wrong with this logging statement?
body: <p>I've recently stumbled upon the following lines of logging code in an existing application. This code looks totally wrong to me in many ways</p>
  
  <pre><code>Method method = ...;// passed in as parameter
  //...
  String className = method.getDeclaringClass().getName();
  String methodName = method.getName();
  long id = Thread.currentThread().getId();
  String name = Thread.currentThread().getName();
  String msg = String.format("some text, for: %s %s in thread %d %s", className, methodName, id, name);
  LOGGER.debug("xxxxxxxx {}", msg);
  </code></pre>
  
  <p>I'd like to know</p>
  
  <ul>
  <li>what is all wrong in this code?</li>
  <li>what has the biggest impact on performance?</li>
  <li>what is the best way for writing a logging statement such as this?</li>
  </ul>
  
  <p>(Note: as the <code>{}</code> indicates, it's a SLF4J logger and the <code>xxxxxxxx</code> is a unique string to identify this particulary logging statement in the codebase)</p>