How to set up logging level for Spark application in IntelliJ IDEA?

前端 未结 6 2429
旧时难觅i
旧时难觅i 2021-02-20 04:25

I\'m working on a Scala project in IntelliJ that was created through SBT. The project has Spark as one of its dependencies. I\'m still in the development phase so everything is

6条回答
  •  南方客
    南方客 (楼主)
    2021-02-20 04:48

    I would love to figure out how to do this with a project local properties file (an example file would be nice), but I was able to get this done in Spark 2.2 with the following code:

    import org.apache.log4j.{Level, Logger}
    
    object MySparkApp {
    
        def main(args: Array[String]): Unit = {
          Logger.getLogger("org.apache.spark").setLevel(Level.WARN)
    

提交回复
热议问题