diff --git a/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala b/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala index f4d9fe06639e8..c799d57cd957c 100644 --- a/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala +++ b/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala @@ -144,7 +144,7 @@ private[spark] class SparkSubmit extends Logging { try { proxyUser.doAs(new PrivilegedExceptionAction[Unit]() { override def run(): Unit = { - runMain(args) + runMain(args, uninitLog) } }) } catch { @@ -159,15 +159,10 @@ private[spark] class SparkSubmit extends Logging { } } } else { - runMain(args) + runMain(args, uninitLog) } } - // Let the main class re-initialize the logging system once it starts. - if (uninitLog) { - Logging.uninitialize() - } - // In standalone cluster mode, there are two submission gateways: // (1) The traditional RPC gateway using o.a.s.deploy.Client as a wrapper // (2) The new REST-based gateway introduced in Spark 1.3 @@ -779,8 +774,13 @@ private[spark] class SparkSubmit extends Logging { * Note that this main class will not be the one provided by the user if we're * running cluster deploy mode or python applications. */ - private def runMain(args: SparkSubmitArguments): Unit = { + private def runMain(args: SparkSubmitArguments, uninitLog: Boolean): Unit = { val (childArgs, childClasspath, sparkConf, childMainClass) = prepareSubmitEnvironment(args) + // Let the main class re-initialize the logging system once it starts. + if (uninitLog) { + Logging.uninitialize() + } + if (args.verbose) { logInfo(s"Main class:\n$childMainClass") logInfo(s"Arguments:\n${childArgs.mkString("\n")}")