How to interpret Vertx Web LoggerHandler output

I am using LoggerHandler in a vertx web project. I am a bit confused about the output of the logger:

WARNING: 0:0:0:0:0:0:0:1 - - [Sat, 15 Jan 2022 18:38:43 GMT] "DELETE /article_categories/1 HTTP/1.1" 400 102 "http://cbt:8080/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4479.0 Safari/537.36"

In particular, which figure represents the duration of the request?


Solution 1:

You were actually very close to what you were looking for.

If you drilldown into the documentation you provided (https://vertx.io/docs/vertx-web/java/#_request_logger) you will see it has a LoggerFormat (https://vertx.io/docs/apidocs/io/vertx/ext/web/handler/LoggerFormat.html#DEFAULT)

Default format is remote-client - - [timestamp] "method uri version" status content-length "referrer" "user-agent"

So if we breakdown your log:

log level: WARNING
remote-client: 0:0:0:0:0:0:0:1
timestamp: [Sat, 15 Jan 2022 18:38:43 GMT]
method: DELETE
uri: /article_categories/1
version: HTTP/1.1
status: 400
content-length: 102
referrer: http://cbt:8080/ 
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4479.0 Safari/537.36

For your main question, none of them refer to the duration of the request.

Vert.x does have a ResponseTimeHandler:

  • https://vertx.io/docs/vertx-web/java/#_response_time_handler
  • https://vertx.io/docs/apidocs/io/vertx/ext/web/handler/ResponseTimeHandler.html