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

LoggerContext should skip looking up localhost when hostName is configured.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.8.2
    • 2.15.0
    • Core
    • None

    Description

      LoggerContext.java:608[1]should use computeIfAbsent instead of putIfAbsent.

      When DNS is disabled on certain systems, NetUtils.getLocalHostname() will block and prevent LoggerContext from initializing correctly. When hostName is configured, NetUtils.getLocalHostname() should not be evaluated.

       

      [1] https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java#L608

      Attachments

        Issue Links

          Activity

            People

              ckozak Carter Kozak
              royzhou Roy Zhou
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: