Skip to content

%<cqtx> log field shows HTTP/1.1 for HTTP/2 requests #10066

Description

@lzx404243

Issue

The %<cqtx> logs the client request line consisting of the method, uri and the http version. The http version is inaccurate for http/2 requests:

127.0.0.1 - - [18/Jul/2023:23:01:45 -0000] "POST https://127.0.0.1:61016/some/path3?foo=bar HTTP/1.1" 404 0

workaround

To capture the client request line with the accurate http version, the %<cqtx> field can be replaced by %<cqhm> %<pqu> %<cqpv> , like in the following logging.yaml:

logging:
  formats:
    - name: old
      format: '%<chi> - %<caun> [%<cqtn>] "%<cqtx>" %<pssc> %<pscl>'
    - name: new
      format: '%<chi> - %<caun> [%<cqtn>] "%<cqhm> %<pqu> %<cqpv>" %<pssc> %<pscl>'
  logs:
    - filename: access
      format: old
    - filename: access-new
      format: new

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions