How to stop INFO messages displaying on spark console?

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

    Edit your conf/log4j.properties file and change the following line:

    log4j.rootCategory=INFO, console
    

    to

    log4j.rootCategory=ERROR, console
    

    Another approach would be to :

    Start spark-shell and type in the following:

    import org.apache.log4j.Logger
    import org.apache.log4j.Level
    
    Logger.getLogger("org").setLevel(Level.OFF)
    Logger.getLogger("akka").setLevel(Level.OFF)
    

    You won't see any logs after that.

    Other options for Level include: all, debug, error, fatal, info, off, trace, trace_int, warn

    Details about each can be found in the documentation.

提交回复
热议问题