spark-submit INFO日志

时间:2016-03-14 10:23:11

标签: apache-spark

我使用spark 1.2.1:

/home/ubuntu/spark-1.2.1/bin/spark-submit --master spark://11.11.11.11:7077 --driver-class-path /home/ubuntu/spark-cassandra-connector-java-assembly-1.2.1-FAT.jar --class "$class" "$jar

我在输出中得到了很多日志:

> 16/03/14 09:59:53 INFO AppClient$ClientActor: Connecting to master
> spark://11.11.11.11:7077... 16/03/14 09:59:54 INFO
> SparkDeploySchedulerBackend: Connected to Spark cluster with app ID
> app-20160314095954-0001 16/03/14 09:59:54 INFO AppClient$ClientActor:
> Executor added: app-20160314095954-0001/0 on
> worker-20160314095247-ip-11.11.11.11.ec2.internal-54560 (ip
> -11.11.11.11.ec2.internal:54560) with 4 cores 16/03/14 09:59:54 INFO SparkDeploySchedulerBackend: Granted executor ID
> app-20160314095954-0001/0 on hostPort
> ip-11.11.11.11.ec2.internal:54560 with 4  cores, 10.0 GB RAM 16/03/14
> 09:59:54 INFO AppClient$ClientActor: Executor added:
> app-20160314095954-0001/1 on
> worker-20160314095247-ip-11.11.11.11.ec2.internal-46194 (ip
> -11.11.11.11.ec2.internal:46194) with 4 cores 16/03/14 09:59:54 INFO SparkDeploySchedulerBackend: Granted executor ID
> app-20160314095954-0001/1 on hostPort
> ip-11.11.11.11.ec2.internal:46194 with 4  cores, 10.0 GB RAM 16/03/14
> 09:59:54 INFO AppClient$ClientActor: Executor added:
> app-20160314095954-0001/2 on
> worker-20160314095247-ip-11.11.11.11.ec2.internal-38895 (ip
> -11.11.11.11.ec2.internal:38895) with 4 cores 16/03/14 09:59:54 INFO SparkDeploySchedulerBackend: Granted executor ID
> app-20160314095954-0001/2 on hostPort
> ip-11.11.11.11.ec2.internal:38895 with 4  cores, 10.0 GB RAM 16/03/14
> 09:59:54 INFO AppClient$ClientActor: Executor updated:
> app-20160314095954-0001/1 is now LOADING 16/03/14 09:59:54 INFO
> AppClient$ClientActor: Executor updated: app-20160314095954-0001/0 is
> now LOADING 16/03/14 09:59:54 INFO AppClient$ClientActor: Executor
> updated: app-20160314095954-0001/2 is now LOADING 16/03/14 09:59:54
> INFO AppClient$ClientActor: Executor updated:
> app-20160314095954-0001/0 is now RUNNING 16/03/14 09:59:54 INFO
> AppClient$ClientActor: Executor updated: app-20160314095954-0001/1 is
> now RUNNING 16/03/14 09:59:54 INFO AppClient$ClientActor: Executor
> updated: app-20160314095954-0001/2 is now RUNNING

如何禁用INFO日志?

1 个答案:

答案 0 :(得分:1)

您可以在JAR的资源中创建log4j.xml文件并添加:

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
   <logger name="org.apache.spark">
        <level value="warn"/>
   </logger>
</log4j:configuration>

将所有org.apache.spark条消息的默认记录器级别设置为WARN