Logback Access incompatible with Spring Boot 3.2.x and Jetty 12.x

868 views Asked by At

Spring Boot 3.2.x introduced support for Jetty 12.x. The latter is internally no longer based on Servlet API but on its own Request/ Response abstraction. Therefore, integrations relying on Servlet API like Logback Access don't function any longer, unfortunately: https://github.com/qos-ch/logback/issues/719.

My question is now whether we are stuck with Spring Boot 3.1.x for the time being due to the incompatibility of Logback Access (on version 1.4.14) with Jetty 12 or whether I have overseen any other ways of integration.

  1. We are currently integrating Logback Access by setting the request log on the Jetty server (in a @Configuration bean):
@Bean
JettyServerCustomizer configureAccessLog() {
    return server -> {
        final RequestLogImpl requestLog = new RequestLogImpl();
        requestLog.setResource("/logback-access.xml");
        requestLog.setQuiet(false);
        requestLog.start();
        server.setRequestLog(requestLog);
    };
}

Is there an alternative for setting up Logback Access with Jetty 12 within Spring Boot 3.2.x?

  1. While Spring Boot 3.2.x added support for Jetty 12, it doesn't say anything about former Jetty versions. Is it correct though that it thereby drops Jetty 11 support? Or is there any other way to set up Jetty 11 with Spring Boot 3.2.x? Since spring-boot-starter-jetty 3.1.6 has completely different list of dependencies than 3.2.0 (due to refactoring in Jetty 12), I don't see how simply setting a version property for spring-boot-starter-jetty 3.2.x might enable Jetty 11. I also tried to run Spring Boot 3.2.0 with only spring-boot-starter-jetty in version 3.1.6 but this breaks our tests with the following exception, which I assume points to an incompatibility:
Caused by:
org.springframework.boot.web.context.MissingWebServerFactoryBeanException: No qualifying bean of type 'org.springframework.boot.web.servlet.server.ServletWebServerFactory' available: Unable to start AnnotationConfigServletWebServerApplicationContext due to missing ServletWebServerFactory bean
    at app//org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getWebServerFactory(ServletWebServerApplicationContext.java:216)
    at app//org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:186)

Do you have any other ideas or pointers?

0

There are 0 answers