title: In Grails 3.1.x, how do I configure grails logging to include the class, method and line number in the logging statement?
body: <p>The class that gets printed is the logging framework's class, not the groovy class that contains the log statement. The method is always 'call', and line number is always -1.</p>
  
  <p>logback pattern:</p>
  
  <pre><code>pattern = "%date{ISO8601} [%-5level] %class{100}::%method:%line %msg%n"
  </code></pre>
  
  <p>Calling logger in MyController.class:</p>
  
  <pre><code>log.info("Some message);
  </code></pre>
  
  <p>results in</p>
  
  <pre><code>2017-03-22 09:44:28,088 [INFO ] org.apache.commons.logging.Log$info$0::call:-1 Some message
  </code></pre>
  
  <p>Alternately, trying to use the logger conversion word in the pattern can provide the class, but not the method or line number.</p>
  
  <p>logback pattern:</p>
  
  <pre><code>pattern = "%date{ISO8601} [%-5level] %logger{100}::%method:%line %msg%n"
  </code></pre>
  
  <p>Calling logger in MyController.class:</p>
  
  <pre><code>log.info("Some message);
  </code></pre>
  
  <p>results in</p>
  
  <pre><code>2017-03-22 09:48:13,185 [INFO ] grails.app.controllers.com.mypackage.MyController::call:-1 Some message
  </code></pre>
  
  <p>There is a very similar problem in the Play framework, but the solution is Play specific:
  <a href="https://stackoverflow.com/a/28820410/258896">https://stackoverflow.com/a/28820410/258896</a></p>
  
  <p>Using:</p>
  
  <p>Grails 3.1.14</p>