Apache and Tomcat both make it easy to log response times out to the server access log (with the %D pattern), but I\'ve been unable to find any equivalent support in Jetty,
Using logback access 1.1.0 or later, you can use the %elapsedTime
conversion word to get the response time in ms. From https://logback.qos.ch/manual/layouts.html :
D / elapsedTime The time taken to serve the request, in milliseconds. T / elapsedSeconds The time taken to serve the request, in seconds.
For example, using:
%h %l %u [%t] "%r" %s %b "%i{Referer}" "%i{User-Agent}" %elapsedTime{}ms
Will output:
0:0:0:0:0:0:0:1 - - [03/Jun/2018:08:07:12 +1200] "GET /actuator/health HTTP/1.1" 200 15 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36" 3ms