Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-3572

LoggerConfig could provide the information if level is explicitly set or inherited

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.18.0
    • 2.19.0
    • Core
    • None

    Description

      When org.apache.logging.log4j.core.config.LoggerConfig.level is set to null the logging level is inherited from the parent:

      public Level getLevel() {
        return level == null ? parent == null ? Level.ERROR : parent.getLevel() : level;
      } 
      

      It would be useful to know if level is explicitly set or inherited.

      Something like: hasLevel(), isLevelSet(), isLevelInherited(), or something that fits into Log4j terminology.

      Attachments

        Activity

          People

            Unassigned Unassigned
            va11 Attila Varga
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: