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

LoggerContext names in web apps are cryptic

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3, 2.4, 2.4.1
    • Fix Version/s: 2.5
    • Component/s: Configurators, JMX
    • Labels:
      None

      Description

      LoggerContext names currently look like "5e90b76c", or "AsyncContext@5e90b76c". Originally the LoggerContext name was ClassLoader.toString(), but this had issues for very long multi-line classloader descriptions (LOG4J2-666).

      The problem with the current naming is that a web container with multiple web applications deployed will not be able to determine which of the Log4j2 JMX MBeans maps to which web application. Similarly, debug-level status messages at startup cannot be mapped to the correct web app.

      The place to address this is probably Log4jContextFactory.getContext(String fqcn, ClassLoader loader, Object externalContext, boolean currentContext, URI configLocation, String name).
      The specified name is currently ignored.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                remkop@yahoo.com Remko Popma
                Reporter:
                remkop@yahoo.com Remko Popma
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: