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

Unable to use LevelChangePropagator in a modular application

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.5.7
    • 1.3.0-alpha10
    • logback-classic
    • None
    • JDK16

    Description

      Using LevelChangePropagator in Logback configuration causes the following exception in a modular application:

      Exception in thread "main" java.lang.IllegalAccessError: class ch.qos.logback.classic.jul.LevelChangePropagator (in module ch.qos.logback.classic) cannot access class java.util.logging.LogManager (in module java.logging) because module ch.qos.logback.classic does not read module java.logging
      

      I'm not sure how the multi-release system works exactly, but the java.logging module is not present currently in the module-info file. As it only makes sense to require the module if the LevelChangePropagator is used (as far as I know, I don't believe the core of Logback Classic would require java.logging?), I'd imagine adding a requires static java.logging statement should be enough.

      There is an open pull request for this issue, but it features a plain requires statement which forces the requirement for all users whether they need it or not.

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            iajn Iiro Nykänen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: