Replies: 3 comments 7 replies
-
Would it be feasible to create a thin abstraction layer to decouple those modules from direct dependence on the Servlet API? Perhaps just a collection of interfaces that could be implemented using the APIs from both namespaces, and then a logback user could simply include the right EE API adapter (e.g. logback-java-ee.jar or logback-jakarta-ee.jar). Conceptually similar to the way slf4j adapts to the logging provider. |
Beta Was this translation helpful? Give feedback.
-
Would maybe the easiest (and less magic) option be to have the core-code/"business logic" in -core, and have thin delegating jars/layers which are either javax or jakarta based? |
Beta Was this translation helpful? Give feedback.
-
My two cents... For the servlet-api, would it be possible to provide two distinct implementations of the related Logback components, one for Java EE and the other for Jakarta EE, and let the user choose to use one or the other in his configuration? A similar approach can be followed for the mail API. An alternative here is to introspect the class path at runtime and dynamically choose which implementation to use (or delegate). That would be "transparent" for the user. |
Beta Was this translation helpful? Give feedback.
-
Strategy for supporting both Java EE and Jakarta EE in logback distributions
Given that our downstream users are likely to use either Java EE or (in the javax namespace) and and Jakarta EE (in the jakarta namespace) in their projects, we feel that it is important for logback to support both alternatives.
Logback consists of 3 modules, namely logback-core, logback-classic and logback-access, which depend on either {javax|jakarta}.mail or {javax|jakarta}.servlet.
Currently logback 1.2.x and 1.3.0-SNAPSHOT support Java EE, while 1.3.0-beta0 supported Jakarta EE (reverted to Java EE in 1.3.0-SNAPSHOT).
SMTPAppender
(using the javax namespace) andJakartaSMTPAppender
.Are their better alternatives?
Update: Logback will ship in two nearly identical versions, namely 1.3 and 1.4 differing in the following ways:
Beta Was this translation helpful? Give feedback.
All reactions