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

Clean API to get all loggers at runtime

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • API
    • None

    Description

      I am trying to achieve a UI interface that looks just like the one provided by the excellent JHipster. This allows you to toggle the log levels at runtime, which is exceptionally useful when diagnosing issues in the field.

      Below we can see a screenshot of the idea I am talking about:  https://www.jhipster.tech/screenshots/

      The feature request is for a clean API to do this officially.

      My feeling is that the current ways require me to assume a specific Logging Context which I have to get from the LoggingManager which defeats the whole point of the SLF4J facade.

      The following question and answer shows this approach for Log4J2: unable to get all loggers using log4j2 -> https://stackoverflow.com/a/49232855/231860

      {{LoggerContext logContext = (LoggerContext) LogManager.getContext(false); Collection<Logger> allLoggers = logContext.getLoggers(); }}

      I have asked this question on stack overflow here:

      https://stackoverflow.com/questions/51998669/is-it-possible-to-get-all-loggers-from-slf4j-log4j2-or-logback

      Attachments

        Activity

          People

            Unassigned Unassigned
            lukaszmac Lukasz Machowski
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: