如何降低星火的运行时输出的详细程度? [英] How to reduce the verbosity of Spark's runtime output?

查看:126
本文介绍了如何降低星火的运行时输出的详细程度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何降低的跟踪信息量星火运行时产生的?

默认值是太冗长,

如何关闭它,并把它当我需要的。

感谢

详细模式

 斯卡拉> VAL LA = sc.parallelize(名单(12,4,5,3,4,4,6,781))
斯卡拉> la.collect
15/01/28 9时57分24秒INFO SparkContext:开始的工作:收集AT<&控制台GT;:15
15/01/28 9时57分24秒INFO DAGScheduler:得到作业3(收集AT<&控制台GT;:15),1路输出
...
15/01/28 9时57分24秒INFO执行人:在第一阶段3.0运行的任务0.0(TID 3)
15/01/28 9时57分24秒INFO执行人:在第一阶段3.0(TID 3)成品任务0.0。 626个字节的结果发送到驱动器
15/01/28 9时57分24秒INFO DAGScheduler:第3阶段(收集AT<&控制台GT;:15)完成了0.002小号
15/01/28 9时57分24秒INFO DAGScheduler:作业3完成:收集AT<&控制台GT;:15,花了0.020061小号
res5:数组[INT] =阵列(12,4,5,3,4,4,6,781)

静音模式(预期)

 斯卡拉> VAL LA = sc.parallelize(名单(12,4,5,3,4,4,6,781))
斯卡拉> la.collect
res5:数组[INT] =阵列(12,4,5,3,4,4,6,781)


解决方案

学习星火的书引述


  

您可能会发现,得到印在外壳的日志记录语句
  分心。您可以控制​​记录的详细程度。去做这个,
  您可以创建在conf目录下的文件名为 log4j.properties
  星火开发人员已经包括这个文件称为模板
   log4j.properties.template 。为了使记录更简洁,使
  副本的conf / log4j.properties.template 名为的conf / log4j.properties
  并找到以下行:


  
  

log4j.rootCategory = INFO,控制台


  
  

然后
  降低日志级别,使我们只显示由WARN消息及以上
  将其更改为以下内容:


  
  

log4j.rootCategory = WARN,控制台


  
  


  您重新打开外壳,你应该看到更少的输出。


How to reduce the amount of trace info the Spark runtime produces?

The default is too verbose,

How to turn off it, and turn on it when I need.

Thanks

Verbose mode

scala> val la = sc.parallelize(List(12,4,5,3,4,4,6,781))
scala> la.collect
15/01/28 09:57:24 INFO SparkContext: Starting job: collect at <console>:15
15/01/28 09:57:24 INFO DAGScheduler: Got job 3 (collect at <console>:15) with 1 output 
...
15/01/28 09:57:24 INFO Executor: Running task 0.0 in stage 3.0 (TID 3)
15/01/28 09:57:24 INFO Executor: Finished task 0.0 in stage 3.0 (TID 3). 626 bytes result sent to driver
15/01/28 09:57:24 INFO DAGScheduler: Stage 3 (collect at <console>:15) finished in 0.002 s
15/01/28 09:57:24 INFO DAGScheduler: Job 3 finished: collect at <console>:15, took 0.020061 s
res5: Array[Int] = Array(12, 4, 5, 3, 4, 4, 6, 781)

Silent mode(expected)

scala> val la = sc.parallelize(List(12,4,5,3,4,4,6,781))
scala> la.collect
res5: Array[Int] = Array(12, 4, 5, 3, 4, 4, 6, 781)

解决方案

quoting from 'Learning Spark' book.

You may find the logging statements that get printed in the shell distracting. You can control the verbosity of the logging. To do this, you can create a file in the conf directory called log4j.properties. The Spark developers already include a template for this file called log4j.properties.template. To make the logging less verbose, make a copy of conf/log4j.properties.template called conf/log4j.properties and find the following line:

log4j.rootCategory=INFO, console

Then lower the log level so that we only show WARN message and above by changing it to the following:

log4j.rootCategory=WARN, console

When you re-open the shell, you should see less output.

这篇关于如何降低星火的运行时输出的详细程度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆