Uploaded image for project: 'JBoss Log Manager'
  1. JBoss Log Manager
  2. LOGMGR-260

System loggers run with level ALL

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.1.15.Final, 3.0.0.Alpha1
    • None
    • core
    • None

      After migrating to Java 11 we were suddenly seeing a lot of caught exceptions sun.rmi.runtime.Log#getSource(). This was surprising to use because we WildFly which sets the "sun.rmi" logger to level WARN. Upon closer inspection the issue is that the logger used by sun.rmi.runtime.Log has level ALL (Integer#MIN_VALUE).

      The issue for this seems to be the following:

      1. since Java 9 java.util.logging differentiates between system loggers (used by modules in the platform classloader) and user loggers (everything else), see java.util.logging#Logger.demandLogger(String, String, Class<?>)
      2. when a system logger is created a second user logger is created and their configurations are merged, however they are merged based on internal state maintained by #setLevel(Level), see java.util.logging.LogManager#demandSystemLogger(String, String, Module) and java.util.logging.Logger#mergeWithSystemLogger(Logger)
      3. org.jboss.logmanager.Logger only ends up calling #setLevel(Level) with Level.ALL therefore the resulting system logger always has the level ALL

      The issue is quite hard to test because:

      1. the effect only happens when the caller of #getLoggger(String) is a system module
      2. the log output is not different, only #isLoggable(Level) checks that shouldn't succeed suddenly succeed so you only see the overhead

              Unassigned Unassigned
              pmarscha Philippe Marschall (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: