views:

36

answers:

1

Hey,

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.

+1  A: 

Enabling the <Valve className="org.apache.catalina.valves.RequestDumperValve"/> in server.xml writes out the request and response headers for each request.

Example:

19-May-2010 12:26:18 org.apache.catalina.valves.RequestDumperValve invoke
INFO:           protocol=HTTP/1.1
JoseK