【问题标题】:Apache Httpd LogFormat can log "trailer lines"?Apache Httpd LogFormat 可以记录“预告片”吗?
【发布时间】:2017-06-07 09:40:55
【问题描述】:

我已经阅读了为 Apache HTTPD 服务器配置自定义 LogFormat 的文档,位于 http://httpd.apache.org/docs/current/mod/mod_log_config.html#formats

在此表中存在这两个条目:

%{VARNAME}^ti   The contents of VARNAME: trailer line(s) in the request sent to the server.
%{VARNAME}^to   The contents of VARNAME: trailer line(s) in the response sent from the server. 

我试图弄清楚这两个是什么意思,但到目前为止我一直很不走运。这两个是什么意思?请求/响应中会记录什么?

【问题讨论】:

    标签: apache logging apache2


    【解决方案1】:

    从技术上讲,某些类型的 HTTP 请求或响应可能具有“预告片”,即包含在消息末尾而不是开头的标头。例如:

    HTTP/1.1 200 OK
    Trailer: Expires
    
    <response content>
    
    Expires: <date>
    

    %{}^ti%{}^to 日志格式可用于记录这些预告片。

    不确定这是做什么用的?别担心,你并不孤单。大多数 HTTP 客户端和服务器(包括 Web 浏览器)不支持或使用预告片。除非您的应用程序专门使用 HTTP 尾部,否则您可以放心地忽略它。

    【讨论】:

    猜你喜欢
    • 2018-06-08
    • 1970-01-01
    • 2011-02-13
    • 1970-01-01
    • 2016-05-13
    • 1970-01-01
    • 2012-10-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多