title: How to configure logback to get nice logs of akka-http logRequest event
body: <p>As a result of the answer to <a href="https://stackoverflow.com/questions/54480020/how-to-make-akka-http-logrequest-log-to-a-specific-logger-log-file">this question</a> I am able to get logRequest to log to a file called access.log.</p>
  
  <p>I have</p>
  
  <pre><code>val routes =
        path("ping" ) {
          withLog(accessLog) {
            logRequest("ping", Logging.InfoLevel) {
              complete("pong")
            }
          }
        }
  </code></pre>
  
  <p>Part of my logback.xml configuration looks like </p>
  
  <pre><code> &lt;appender name="ACCESSLOG" class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
          &lt;file&gt;log/access.log&lt;/file&gt;
          &lt;encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"&gt;
              &lt;pattern&gt;
                  %d{yyyy-MM-dd HH:mm:ss} %msg%n
              &lt;/pattern&gt;
          &lt;/encoder&gt;
          &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
              &lt;fileNamePattern&gt;log/access-%d{yyyy-MM-dd}.%i.log&lt;/fileNamePattern&gt;
              &lt;timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"&gt;
                  &lt;maxFileSize&gt;64 MB&lt;/maxFileSize&gt;
              &lt;/timeBasedFileNamingAndTriggeringPolicy&gt;
          &lt;/rollingPolicy&gt;
      &lt;/appender&gt;
  </code></pre>
  
  <p>And the resulting entry in the log file looks like</p>
  
  <pre><code>2019-02-06 16:51:04 ping: HttpRequest(HttpMethod(GET),http://localhost:8080/ping,List(Host: localhost:8080, Connection: keep-alive, Cache-Control: max-age=0, Upgrade-Insecure-Requests: 1, User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36, Accept: text/html, application/xhtml+xml, application/xml;q=0.9, image/webp, image/apng, */*;q=0.8, Accept-Encoding: gzip, deflate, br, Accept-Language: en-GB, en-US;q=0.9, en;q=0.8, Cookie: xxx, Timeout-Access: &lt;function1&gt;),HttpEntity.Strict(none/none,ByteString()),HttpProtocol(HTTP/1.1))
  </code></pre>
  
  <p>What can I do to get my log entries to look something like</p>
  
  <pre><code>2019-02-06 16:51:04 GET /ping &lt;time_taken&gt; 
  </code></pre>