Giter Club home page Giter Club logo

Comments (5)

miknem avatar miknem commented on September 18, 2024 6

Hi @mvestola we ran into the same problem at the company where I work and we found no workaround for this to get it working with Jetty 12/ Spring Boot 3.2.
So what we did to get around this problem we did a separate implementation of the Logback access RequestLogImpl and corresponding classes to work with the new Jetty 12 classes.
We have published some example code here https://github.com/miknem/logback-access-jetty12 of what we did to get it working (and so far this seems to work, at least for Spring Boot 3.2).

Ideally we would have preferred to get this implemented in the logback-access framework, but like already mentioned above here in this discussion the Jetty classes are completely different and we did not manage to find any good way to create a pull request to get this merged without breaking backwards compatibility with older versions of Jetty.

from logback.

ceki avatar ceki commented on September 18, 2024 2

@yachtintheband logback-access moved to its own repo. It already supports Jetty 12.

from logback.

ceki avatar ceki commented on September 18, 2024 1

Logback-access version 2.0.0 has been released. It supports Jetty versions 11 and 12.

from logback.

zUniQueX avatar zUniQueX commented on September 18, 2024

Hi @mvestola. Supporting this without inconvenience for users won't be possible for logback.

As you've correctly mentioned, the Jetty Request doesn't implement the HttpServletRequest interface anymore. The Request objects get wrapped throughout the handler chain and, if a ServletContextHandler is registered, the handler chain will eventually contain a ServletContextRequest where the getServletApiRequest() method can be called to get an instance of HttpServletRequest. But this object won't be available in the request log stage because there the HttpChannelState.ChannelRequest.getLoggedRequest() will be provided. This defaults to the ChannelRequest itself and cannot obtain the ServletContextRequest by default.

To overcome this problem, the ServletContextRequest has to be set as the logged request. This has to be done by unwrapping the request during processing (after the ServletContextHandler has been executed) and calling the setLoggedRequest(Request) method.

It would be inconvenient, if a user would have to register a custom handler to get the request log working, but it would also be incovenient, if logback would register the handler itself.

For reference, see the modifications I've made to Dropwizard to get the RequestLogImpl working with Jetty 12:

from logback.

yachtintheband avatar yachtintheband commented on September 18, 2024

Is there a timeline yet on when we think this might go in? Or is the plan that logback access will not be compatible with Jetty long term?

from logback.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.