Comments (5)
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.
@yachtintheband logback-access moved to its own repo. It already supports Jetty 12.
from logback.
Logback-access version 2.0.0 has been released. It supports Jetty versions 11 and 12.
from logback.
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.
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)
- Randomly occuring NPE when logging HOT 2
- BlockingQueue<E> blockingQueue;
- License update?
- Mask or remove specific words from log line HOT 4
- Conditional expressions evaluated in a weird order causing configuration discrepancies HOT 3
- Stack Overflow in ThrowableProxy
- Using non-existent appender in root - no logging in other files HOT 1
- Archiving is triggered only when log is being written.
- SpringBoot3,JDK17 使用logback配置了<configuration debug="false">依然会打印logback内部日志 HOT 2
- How to print virtual thread name in logback HOT 1
- pattern cannot be displayed properly
- String values with an unmatched right curly brace } drop the brace and subsequent characters
- Properties in a log statement are shoved in to message in JsonEncoder
- logback 1.5.6 using in undowtow working not properly. HOT 1
- logback-classic 1.5.5 breaks springProperty handle from included xml in a spring boot app, openjdk 17 HOT 1
- LogbackValue does not implement Context correctly (1.5.7) HOT 2
- version_1.2.13 Hourly generated logs cannot be deleted HOT 2
- zstandard for compression
- log file not getting generated after migrating to java 17 HOT 12
- Change in LoggerContext.getConfigurationLock causes NoSuchMethodError in Spring Boot HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logback.