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

groovy-based configuration tries to resolve the hostname eagerly, failing in environments with no hostname

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.3
    • Fix Version/s: None
    • Component/s: logback-classic
    • Environment:

      Aws Lambda

      Description

      When configuring logback via a logback.groovy, the first thing that the GafferConfigurator does is call binding.setProperty("hostname", ContextUtil.localHostName);.

      In a serverless environment, such as AWS Lambda, this fails with a UnknownHostException. As I understand it Lambdas don't have hostnames as they can't be addressed from the internet.

      We should either wrap this line in a try/catch or move the hostname resolution to where it is used.

        Attachments

          Activity

            People

            • Assignee:
              logback-dev Logback dev list
              Reporter:
              kmorozov Kirill Morozov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: