Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #9980 - add additional codes for CustomRequestLog #12322

Merged
merged 6 commits into from
Oct 21, 2024

Conversation

lachlan-roberts
Copy link
Contributor

@lachlan-roberts lachlan-roberts commented Sep 27, 2024

Adds the following options to the CustomRequestLog

%A                    - the Request authority (which might differ from the Host header).
%h                    - the Request scheme
%uri                  - the entire Request HttpURI (including query)
%{q}uri               - the entire Request HttpURI (excluding query)
%{attributeName}attr  - a request attribute

Let me know if you can think of better codes for these.

closes #9980

@joakime joakime self-assigned this Sep 27, 2024
@joakime
Copy link
Contributor

joakime commented Oct 2, 2024

Can request scheme be %S instead?

Or perhaps enhance the param portion of %{param}uri to work with the parts of the uri?

like ...

%uri               = entire request URI
%{-query}uri       = entire request URI (sans query)
%{scheme}uri       = scheme of request URI
%{authority}uri    = authority of request URI
%{path}uri         = path of request URI
%{query}uri        = query of request URI
%{-path,-query}uri = request URI without path or query (so just `scheme://authority/`)

@sbordet
Copy link
Contributor

sbordet commented Oct 2, 2024

I agree with @joakime as long as we have also %{host}uri and %{port}uri.

Signed-off-by: Lachlan Roberts <[email protected]>
@lachlan-roberts
Copy link
Contributor Author

lachlan-roberts commented Oct 9, 2024

I have added the changes requested.

Note that there are now some duplicate codes:

%U - %{path}uri
%q - %{query}uri

joakime
joakime previously approved these changes Oct 11, 2024
Copy link
Contributor

@sbordet sbordet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor nits on the javadocs.

@lachlan-roberts lachlan-roberts merged commit 1483d14 into jetty-12.0.x Oct 21, 2024
10 checks passed
@lachlan-roberts lachlan-roberts deleted the jetty-12.0.x-9980-customrequestlog branch October 21, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Add format option to CustomRequestLog for request authority and request authority scheme
3 participants