1. 程式人生 > >SPARK 日誌輸出關鍵資訊

SPARK 日誌輸出關鍵資訊

來自https://www.cnblogs.com/liugh/p/6909531.html

使用spark-submit提交local任務時,會輸出很多Info資訊:

複製程式碼
-------------------------------------------
Time: 1495788633000 ms
-------------------------------------------

17/05/26 08:50:33 INFO scheduler.JobScheduler: Finished job streaming job 1495788633000 ms.2 from job set of time 1495788633000
ms 17/05/26 08:50:33 INFO scheduler.JobScheduler: Total delay: 0.054 s for time 1495788633000 ms (execution: 0.046 s) 17/05/26 08:50:33 INFO rdd.MapPartitionsRDD: Removing RDD 177 from persistence list 17/05/26 08:50:33 INFO storage.BlockManager: Removing RDD 177 17/05/26 08:50:33 INFO rdd.MapPartitionsRDD: Removing RDD 176 from
persistence list 17/05/26 08:50:33 INFO storage.BlockManager: Removing RDD 176 17/05/26 08:50:33 INFO rdd.BlockRDD: Removing RDD 175 from persistence list 17/05/26 08:50:33 INFO dstream.SocketInputDStream: Removing blocks of RDD BlockRDD[175] at socketTextStream at CoGroupTest.scala:21 of time 1495788633000 ms 17/05/26
08:50:33 INFO storage.BlockManager: Removing RDD 175 17/05/26 08:50:33 INFO rdd.MapPartitionsRDD: Removing RDD 178 from persistence list 17/05/26 08:50:33 INFO storage.BlockManager: Removing RDD 178 17/05/26 08:50:33 INFO rdd.MapPartitionsRDD: Removing RDD 180 from persistence list 17/05/26 08:50:33 INFO storage.BlockManager: Removing RDD 180 17/05/26 08:50:33 INFO scheduler.ReceivedBlockTracker: Deleting batches: 1495788631000 ms 17/05/26 08:50:33 INFO scheduler.InputInfoTracker: remove old batch metadata: 1495788631000 ms 17/05/26 08:50:34 INFO scheduler.JobScheduler: Added jobs for time 1495788634000 ms 17/05/26 08:50:34 INFO scheduler.JobScheduler: Starting job streaming job 1495788634000 ms.0 from job set of time 1495788634000 ms
複製程式碼

  可以修改log4j的日誌級別,只輸出關鍵資訊:

1.修改$SPARK_HOME/conf/log4j.properties

  如果有log4j.properties.template,則複製一份為log4j.properties

  cp log4j.properties.template log4j.properties

2.修改第一行

  log4j.rootCategory=INFO, console

  為

  log4j.rootCategory=ERROR, console

3.再次提交任務,只會輸出關鍵資訊:

-------------------------------------------
Time: 1495788788000 ms
-------------------------------------------
(helloworld,helloworld_one)
(hello,hello_one)
(join,join_one)