简体   繁体   English

如何解释 Vertx Web LoggerHandler output

[英]How to interpret Vertx Web LoggerHandler output

I am using LoggerHandler in a vertx web project.我在 vertx web 项目中使用LoggerHandler I am a bit confused about the output of the logger:我对记录器的 output 有点困惑:

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?特别是,哪个数字代表请求的持续时间?

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 )如果您深入了解您提供的文档( https://vertx.io/docs/vertx-web/java/#_request_logger ),您将看到它具有LoggerFormathttps://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"默认格式为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, non of them refer to the duration of the request.对于您的主要问题,它们都不是指请求的持续时间。

Vert.x does have a ResponseTimeHandler : Vert.x 确实有一个ResponseTimeHandler

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM