Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1670

Config files ignored when running with Java modules

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.3.0, 1.4.0
    • Fix Version/s: 1.4.1, 1.3.1
    • Component/s: logback-classic
    • Labels:
      None
    • Environment:

      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

        Attachments

          Activity

            People

            Assignee:
            ceki Ceki Gülcü
            Reporter:
            agavrilov Alexey Gavrilov
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: