是否可以在 apache 中记录响应的第一行?
我们有一个 Tomcat 服务器,我们正在尝试记录发送响应的 HTTP 版本。我们已经见过几次,它似乎是 HTTP/0.9,它杀死了内容(我猜不支持?)。我们希望通过使用 apache 中的访问日志来获取一些统计信息。但是,由于此标题行没有任何前缀,因此我们无法使用 %{xxx}o 日志记录。
有办法得到这个吗?
示例:
响应是:
HTTP/1.1 503 This application is not currently available
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Length: 1090
Date: Wed, 12 May 2010 12:53:16 GMT
Connection: close
And we'd like the catch HTTP/1.1 (或者,HTTP/1.1 503 This application is not current available。
这可能吗?我们可以无法访问正在服务的应用程序,因此我们需要作为 Java 过滤器或在 tomcat 访问日志中执行此操作 - 最好在访问日志中。
We have an Tomcat server where we're trying to log the HTTP version which the response is sent with. We've seen a few times that it seems to be HTTP/0.9, which kills the content (not supported I guess?). We would like to get some stats on this by using the access log in apache. However, since the header line for this isn't prefixed by anything, we cannot use the %{xxx}o logging.
Is there a way to get this?
An example:
Response is:
HTTP/1.1 503 This application is not currently available
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Length: 1090
Date: Wed, 12 May 2010 12:53:16 GMT
Connection: close
And we'd like the catch HTTP/1.1 (alternatively, HTTP/1.1 503 This application is not currently available.
Is this possible? We do not have access to the application being served, so we need to do this either as a Java filter, or in the tomcat access log - Preferably in the access log.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
启用 server.xml 中的
会写出每个请求的请求和响应标头。例子:
Enabling the
<Valve className="org.apache.catalina.valves.RequestDumperValve"/>
in server.xml writes out the request and response headers for each request.Example: