gengliangwang commented on code in PR #46309: URL: https://github.com/apache/spark/pull/46309#discussion_r1585637901
########## core/src/main/scala/org/apache/spark/util/Utils.scala: ########## @@ -889,17 +893,18 @@ private[spark] object Utils // because of Inet6Address.toHostName may add interface at the end if it knows about it val strippedAddress = InetAddress.getByAddress(addr.getAddress) // We've found an address that looks reasonable! - logWarning("Your hostname, " + InetAddress.getLocalHost.getHostName + " resolves to" + - " a loopback address: " + address.getHostAddress + "; using " + - strippedAddress.getHostAddress + " instead (on interface " + ni.getName + ")") - logWarning("Set SPARK_LOCAL_IP if you need to bind to another address") + logWarning(log"Your hostname, ${MDC(HOST, InetAddress.getLocalHost.getHostName)}, " + + log"resolves to a loopback address: ${MDC(HOST_PORT, address.getHostAddress)}; " + + log"using ${MDC(HOST_PORT2, strippedAddress.getHostAddress)} instead (on interface " + + log"${MDC(NETWORK_IF, ni.getName)})") + logWarning(log"Set SPARK_LOCAL_IP if you need to bind to another address") return strippedAddress } } - logWarning("Your hostname, " + InetAddress.getLocalHost.getHostName + " resolves to" + - " a loopback address: " + address.getHostAddress + ", but we couldn't find any" + - " external IP address!") - logWarning("Set SPARK_LOCAL_IP if you need to bind to another address") + logWarning(log"Your hostname, ${MDC(HOST, InetAddress.getLocalHost.getHostName)}, " + + log"resolves to a loopback address: ${MDC(HOST_PORT, address.getHostAddress)}, " + + log"but we couldn't find any external IP address!") + logWarning(log"Set SPARK_LOCAL_IP if you need to bind to another address") Review Comment: This one is not needed -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org