Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-16771

"Logging > Level" UI/API does not properly get/update loggers with 'unset' Level

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • main (10.0), 9.3
    • None
    • None

    Description

      If you're using the Solr Admin UI, or the underlying /admin/info/logging request handler, the option to 'unset' a log level (so the specified logger will inherit the effective level from it's parent) doesn't actually work.

      This is because the underlying Log4j2Watcher impl is explicitly calling LoggerConfig.setLevel(Level.OFF) – meaning it won't log anything regardless of what it's parent logger setting is.

      The correct behavior is to use LoggerConfig.setLevel(null)

      While looking into this, I realized that the impls of Log4j2Watcher.getAllLoggers() and Log4j2Watcher.Log4j2Info.isSet() are also really bizarre and don't make much sense – making it impossible to tell in the UI which classes actually have a 'set' value in the underlying Log4j2 configuration.

      ( Just because a LoggerConfig exists for a loggerName, doesn't mean it's Level is "set" – but the code currently assumes it does. That's the distinction between LoggerConfig.getLevel() and LoggerConfig.getExplicitLevel() – the later may return null.)

      Attachments

        1. SOLR-16771.patch
          18 kB
          Chris M. Hostetter

        Activity

          People

            hossman Chris M. Hostetter
            hossman Chris M. Hostetter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: