在學習使用Spark的過程當中,老是想對內部運行過程做深刻的瞭解,其中DEBUG和TRACE級別的日誌能夠爲咱們提供詳細和有用的信息,那麼如何進行合理設置呢,不復雜但也毫不是將一個INFO換爲TRACE那麼簡單。sql
調整Spark日誌級別的配置文件是$SPARK_HOME/conf/log4j.properties,默認級別是INFO,若是曾經將其改成DEBUG的朋友可能會有這樣的經歷,有用的信息還沒看完,就被大量的心跳檢測日誌給淹沒了。apache
只將須要的日誌級別調整爲_TRACE_,而將心跳檢測類的設置爲_INFO_級別以上,避免干擾。markdown
# Set everything to be logged to the console log4j.rootCategory=INFO, console log4j.appender.console=org.apache.log4j.ConsoleAppender log4j.appender.console.target=System.err log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n # Settings to quiet third party logs that are too verbose log4j.logger.org.eclipse.jetty=WARN log4j.logger.org.eclipse.jetty.util.component.AbstractLifeCycle=ERROR log4j.logger.org.apache.spark.repl.SparkIMain$exprTyper=INFO log4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=INFO log4j.logger.org.apache.spark.sql.SQLContext=TRACE log4j.logger.org.apache.spark.sql.catalyst.analysis.Analyzer=TRACE log4j.logger.org.apache.spark=TRACE log4j.logger.org.apache.spark.storage.BlockManagerMasterActor=WARN log4j.logger.org.apache.spark.HeartbeatReceiver=WARN log4j.logger.org.apache.spark.scheduler.local.LocalActor=WARN
第一次在博客園中用markdown格式來寫文章,感受挺簡單的。app