如何在使用spark-submit时在控制台中放置消息? [英] How to drop messages in console when using spark-submit?

查看:956
本文介绍了如何在使用spark-submit时在控制台中放置消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的问题。
当我使用scaal执行spark-submit作业时,我可以在控制台中看到很多状态消息。

I have the strange question. when I run spark-submit job with scaal, I can see a lot of status messages in console.

但我只想看到我的照片。
我可以把任何参数为了看不到这些消息吗?

But I would like to see only my prints. Can I put any parameter in order not to see these messages?

推荐答案

部分。将它放在代码中:

This should do the trick for the most part. Put it inside the code:

import org.apache.log4j.{Level, Logger}
Logger.getLogger("org").setLevel(Level.WARN)
Logger.getLogger("akka").setLevel(Level.WARN)

conf / log4j.properties

log4j.rootCategory=WARN, console

这篇关于如何在使用spark-submit时在控制台中放置消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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