Skip to content

Conversation

josephlbarnett
Copy link
Contributor

@josephlbarnett josephlbarnett commented Mar 20, 2025

Tentative fix for #9773

Extends #9788 to maintain duplicate header handling while we wait for qos-ch/logback-access#23

@josephlbarnett josephlbarnett requested a review from a team as a code owner March 20, 2025 15:01
@github-actions github-actions bot added this to the 5.0.0 milestone Mar 20, 2025
@josephlbarnett josephlbarnett force-pushed the access-requestlog-dup-headers branch from 8cc2b43 to 96a4740 Compare March 28, 2025 14:48
Tentative fix for dropwizard#9773

The test change proves that logback-access's `ResponseWrapper` is not brilliant. Should probably be fixed in logback-access, but could be fixed
@josephlbarnett josephlbarnett force-pushed the access-requestlog-dup-headers branch from 96a4740 to dd6ef69 Compare April 1, 2025 16:06
Copy link
Member

@joschi joschi left a comment

Choose a reason for hiding this comment

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

@josephlbarnett Thanks for your contribution! LGTM.

@zUniQueX Do you also want to take a look since you've been working on the Jetty 12 integration before?

@zUniQueX
Copy link
Member

zUniQueX commented Jun 4, 2025

@josephlbarnett Thanks for your contribution.

I personally don't like what logback does with their wrappers by building an incomplete servlet context. But maybe that's less overhead than what we're currently doing with our own wrapping. Maybe we should stick to Jetty's own request logging as default in 5.x and deprecate the logback logging? This would have the advantage of decoupling from the servlet stage in the request logging too. @joschi What do you think about that?

I've just taken a small look at this change and have to dive into this further. But I think we should also remove the workaround class LogbackAccessRequestLogAwareHandler in this PR when removing the other part of the current workaround.

@joschi
Copy link
Member

joschi commented Jun 4, 2025

Maybe we should stick to Jetty's own request logging as default in 5.x and deprecate the logback logging?

Do you have an idea how much work that would be? Are there suitable extension points so that we can hook it up with our logging (SLF4J) directly without the abstractions in logback-access?

@zUniQueX
Copy link
Member

zUniQueX commented Jun 5, 2025

Do you have an idea how much work that would be? Are there suitable extension points so that we can hook it up with our logging (SLF4J) directly without the abstractions in logback-access?

Not much, as we already use Jetty's own request logging in the dropwizard "classic" request logging 😉

@zUniQueX
Copy link
Member

zUniQueX commented Jun 6, 2025

I'm currently evaluating what the change of entirely removing logback-access would imply for JSON logging etc. Probably, we'll need to rethink how JSON logging for HTTP requests should be done, as we then don't have the logback IAccessEvent with the relevant data in the dropwizard-json-logging module.

@zUniQueX
Copy link
Member

@joschi I've provided a POC of removing logback-access-jetty12 in #10210. Entirely removing logback-access-common would be painful for a migration, as then the IAccessEvent would get removed and all existing configurations for request log appenders could possibly break. I don't think this should be done for 5.x with the current RCs out. We can think of doing this change in Dropwizard 6.

josephlbarnett added a commit to josephlbarnett/leakycauldron that referenced this pull request Jul 24, 2025
Maven and java packages changed to ee10 versions of things.
Websocket API changes invovling callbacks/etc, also the upgrade
process changes to deal with jetty Request vs/ servlet requests.
Similar mock/logging changes for those request APIs.
Adopt dropwizard/dropwizard#9970 to avoid
errors in request logs.

Downstreams might be ok, but API changes ae major enough that
they might not be so bump version and label as breaking change.
josephlbarnett added a commit to josephlbarnett/leakycauldron that referenced this pull request Jul 28, 2025
Maven and java packages changed to ee10 versions of things.
Websocket API changes invovling callbacks/etc, also the upgrade
process changes to deal with jetty Request vs/ servlet requests.
Similar mock/logging changes for those request APIs.
Adopt dropwizard/dropwizard#9970 to avoid
errors in request logs.

Downstreams might be ok, but API changes ae major enough that
they might not be so bump version and label as breaking change.
@joschi joschi merged commit 341235a into dropwizard:release/5.0.x Aug 20, 2025
11 checks passed
@joschi joschi linked an issue Aug 25, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Access request logging fails on bad path in Dropwizard 5
4 participants