Is it possible to log the first line of the response in apache?

Posted by Jeppe Mariager on Stack Overflow See other posts from Stack Overflow or by Jeppe Mariager
Published on 2010-05-18T11:58:33Z Indexed on 2010/05/20 6:40 UTC
Read the original article Hit count: 170

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about apache

Related posts about tomcat