-
Notifications
You must be signed in to change notification settings - Fork 41.7k
Description
I am using Spring Boot 3.2.4 with Jetty (spring boot supplied version) in a 'standard' web mvc project.
When activating the virtual threads feature through configuration within application.yml the logging of the thread names disappears. I am using the default log pattern supplied by spring boot.
I suspect it is related to JettyVirtualThreadsWebServerFactoryCustomizer only using threadPool.setVirtualThreadsExecutor(VirtualThreads.getDefaultVirtualThreadsExecutor());.
The Jetty team has provided another factory method, making it possible to supply a name prefix for virtual threads:
jetty/jetty.project#11353 (comment)
Looking into the codebase of the supplied Jetty, this new factory method seems to be available to Spring Boot already.
My suggestion would be to use this new factory method and assign either a default or a configurable virtual thread name prefix from the Jetty auto configuration (or both 😬).
At least the logged thread name should not be empty when using virtual threads.