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.
|