Varnish,使用标准输出输出 ReqEnd

Varnish,使用标准输出输出 ReqEnd

是否可以输出请求结束在 VCL 中使用 std.log?我想在 varnishncsa 日志记录中使用 ReqEnd。

答案1

您可以向输出添加额外的标志varnishncsa,使其显示更多信息,包括 ReqEnd 报告的一些时间,请参阅文档,特别是-F format选项:

Supported formatters are:

... snip ...

%t
Time when the request was received, in HTTP date/time format.

%{X}t
Time when the request was received, in the format specified by X. The time specification format is the same as for strftime(3).

%{X}x

  Varnish:time_firstbyte
  Time to the first byte from the backend arrived

  Varnish:hitmiss
  Whether the request was a cache hit or miss. Pipe and pass are considered misses.

  Varnish:handling
  How the request was handled, whether it was a cache hit, miss, pass, pipe or error.

  VCL_Log:key
  Output value set by std.log("key:value") in VCL.

相关内容