code: private static String getHostName() {
      String hostName = null;
      try {
        hostName = InetAddress.getLocalHost().getHostName();
      } 
      catch (UnknownHostException ex) {
        LOG.info("Unable to obtain hostName", ex);
        hostName = "unknown";
      }
      return hostName;
    }
docs: Returns the host name.  If the host name is unobtainable, logs the
  exception and returns "unknown".