DropWizard中默认HTTP请求日志格式的每个字段的含义 [英] Meaning of each field in default Format of HTTP Request Log in DropWizard

查看:106
本文介绍了DropWizard中默认HTTP请求日志格式的每个字段的含义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Dropwizard中生成的访问日志具有以下格式:-

The access log that get generated in Dropwizard are something of following format:-

10.10.10.10--[16 / Mar / 2015:23:59:59 +0530] GET /yyyy/vx.x/uri HTTP / 1.1 200--- 1

10.10.10.10 - - [16/Mar/2015:23:59:59 +0530] "GET /yyyy/vx.x/uri HTTP/1.1" 200 - "-" "-" 1

字段1:-10.10.10.10(Ip

Field 1 :- 10.10.10.10 (Ip Address from which request came)

字段2:-[16 / Mar / 2015:23:59:59 +0530](请求到达的时间和日期)

Field 2 :- [16/Mar/2015:23:59:59 +0530] (Time and Date when request came)

字段3:- GET /yyyy/vx.x/uri HTTP / 1.1(HTTP Rest API方法)

Field 3 :- "GET /yyyy/vx.x/uri HTTP/1.1" (HTTP Rest API method)

字段4:-200(HTTP响应代码)

Field 4 :- 200 (HTTP Response code)

字段5:--(????)

Field 5 :- "-" (????)

字段6:--(????)
字段7:-1(????)

Field 6 :- "-" (????) Field 7 :- 1 (????)

有人以访问日志格式解释每个字段的含义?我对最后一栏的意思更好奇。

Can someone explain the meaning of each field in access log format? I am more curious about the last column meaning.

感谢帮助。

推荐答案

此日志实际上是由Jetty,它是 NCSA通用日志格式的扩展版本。您可以查看源(搜索 log 方法)

This logging is actually generated by Jetty and is an extended version of the NCSA common log format. You can view the source (search for the log method).

默认设置记录以下内容:

The default settings log the following:


  • 远程服务器地址

  • The remote server address

可选身份验证信息

请求日期和时间

请求的HTTP方法,URI和协议

The HTTP method, URI, and protocol for the request

HTTP响应状态代码

The HTTP response status code

响应长度

HTTP引用标头(如果已设置)

The HTTP referer header (if set)

HTTP用户代理(如果已设置)

The HTTP user agent (if set)

日志延迟

最后一个字段(其中您特别询问过的)是请求时间与日志消息构建之间的延迟时间(以毫秒为单位),实际上是服务器处理请求所花的时间。

The last field (which you asked about in particular) is the latency in milliseconds between the time of the request and the construction of the log message - effectively how long it took the server to handle the request.

这篇关于DropWizard中默认HTTP请求日志格式的每个字段的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆