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

Unable to use LevelChangePropagator in a modular application

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.3.0-alpha10
    • Fix Version/s: 1.4.6
    • Component/s: logback-classic
    • Labels:
      None
    • Environment:

      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

          Issue Links

            Activity

              People

              Assignee:
              logback-dev Logback dev list
              Reporter:
              iajn Iiro Nykänen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: