gpt4 book ai didi

java - Tomcat 日志 : What's the difference between %D and %F?

转载 作者:搜寻专家 更新时间:2023-11-01 02:58:52 28 4
gpt4 key购买 nike

我正在使用 Tomcat 日志来记录访问信息。而官方文档中%D%F的定义是:

  • %D - 处理请求所花费的时间,以毫秒为单位

  • %F - 提交响应所花费的时间,以毫秒为单位

我对这两个定义感到困惑。 %F的时间是否包括%D的时间?

最佳答案

%D 包括 %F 加上任何网络时间

API 文档中有更多信息 https://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/valves/AccessLogValve.html

AccessLogValve.ElapsedTimeElement write time taken to process therequest - %D, %T

AccessLogValve.FirstByteTimeElement write time until first byte iswritten (commit time) in millis - %F

Bugzilla 55102 entry for %F它说:

Tomcat's AccessLogValve is able to report the time taken to send anentire request using %D. This is the total processing time and may beaffected by network conditions. It is sometimes useful to be able torecord the time taken by the server to prepare the response and sendthe first content to the client.

Attached is a patch that records the time the response is committedand then allows that to be reported in the access log using a %Fpattern (which is the same as used by the mod-log-firstbyte module forHTTPD).

关于java - Tomcat 日志 : What's the difference between %D and %F?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42685694/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com