Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1228

Logback broken on AWS

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.1.6, 1.1.7
    • logback-core
    • None

    Description

      When using an EC2 instance within AWS, the hostname is not set by default. Therefore, the following call will throw an exception:

      InetAddress localhost = InetAddress.getLocalHost();
      return localhost.getHostName();
      

      Previously, logback handled this by using the following code:

      try {
          InetAddress localhost = InetAddress.getLocalHost();
          return localhost.getHostName();
      } catch (UnknownHostException e) {
          return getLocalAddressAsString();
      }
      

      However, this commit reverted those changes:
      https://github.com/qos-ch/logback/commit/c2dcbfcfb4048d11d7e81cd9220efbaaccf931fa#diff-5272ed59e3fd3a8248d58fe2bdb38930

      Can we please re-add the code to appropriately handle unknown hostname. Based on the commit description, it looks like this was done in error.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            jdsalingerjr Joseph Carroll
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: