How to stop INFO messages displaying on spark console?

后端 未结 20 3353
广开言路
广开言路 2020-11-22 13:40

I\'d like to stop various messages that are coming on spark shell.

I tried to edit the log4j.properties file in order to stop these message.

Her

20条回答
  •  轮回少年
    2020-11-22 14:40

    Thanks @AkhlD and @Sachin Janani for suggesting changes in .conf file.

    Following code solved my issue:

    1) Added import org.apache.log4j.{Level, Logger} in import section

    2) Added following line after creation of spark context object i.e. after val sc = new SparkContext(conf):

    val rootLogger = Logger.getRootLogger()
    rootLogger.setLevel(Level.ERROR)
    

提交回复
热议问题