How to stop INFO messages displaying on spark console?

后端 未结 20 3357
广开言路
广开言路 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:17

    In Python/Spark we can do:

    def quiet_logs( sc ):
      logger = sc._jvm.org.apache.log4j
      logger.LogManager.getLogger("org"). setLevel( logger.Level.ERROR )
      logger.LogManager.getLogger("akka").setLevel( logger.Level.ERROR )
    

    The after defining Sparkcontaxt 'sc' call this function by : quiet_logs( sc )

提交回复
热议问题