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

LoggerContext should skip looking up localhost when hostName is configured.

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment