According to this, including %H
in your LogFormat
is supposed to log the HTTP protocol version, however, it appears to be unreliable.
As an example, one can telnet to port 80 of the web server and issue a GET / HTTP/2.0
, which will cause Apache to log it as HTTP/2.0, however, this is not valid HTTP2 traffic considering that HTTP2 is a binary protocol and can't (realistically) be executed by a human over telnet. It's easy to demonstrate that the aforementioned request is not actually handled by mod_http2
because nothing changes if the module is disabled, Apache will still process it and still misleadingly log it as if it were actually HTTP2.
Likewise, telnetting to port 80 and issuing a GET / HTTP/9.0
will cause Apache to log the request as HTTP/9.0 even though no such protocol exists.
I think what I really want to log is whether the traffic was actually handled by mod_http2
or not, as that information should come from Apache itself and not be vulnerable to client-side spoofing. Apache should know whether or not the traffic hit that module, but I haven't found a way to log based on that.
There doesn't seem to be anything relevant in the mod_http2 documentation
I am running Apache 2.4.41 on Ubuntu LTS 20.04.5