Details
-
Bug
-
Resolution: Fixed
-
Critical
-
1.3.0, 1.4.0
-
None
-
Java Modules
Description
Logback doesn't load XML configuration files for Java applications running with Java Modules (JPMS).
Run 'run.sh' shell script in this repository to reproduce:
https://github.com/agavrilov76/logback-jpms-bug
The problem is that at startup Logback cannot find 'DefaultJoranConfigurator' (the default implementation of 'ch.qos.logback.classic.spi.Configurator') located inside the 'ch.qos.logback.classic' module. This is because 'ch.qos.logback.classic' doesn't actually declare it provides the implementation.
Adding this line to the module's module-info.java can fix the problem:
provides ch.qos.logback.classic.spi.Configurator with ch.qos.logback.classic.util.DefaultJoranConfigurator;
'ch.qos.logback.classic.servlet.LogbackServletContainerInitializer' should probably declared the same way