2017-11-09 11 views

答えて

1

Pythonスクリプトからのログを削除(または変更)するには:このことができます

conf = SparkConf() 
conf.set('spark.logConf', 'true') # necessary in order to be able to change log level 
... # other stuff and configuration 

# create the session 
spark = SparkSession.builder\ 
    .config(conf=conf) \ 
    .appName(app_name) \ 
    .getOrCreate() 

# set the log level to one of ALL, DEBUG, ERROR, FATAL, INFO, OFF, TRACE, WARN 
spark.sparkContext.setLogLevel("OFF") 

docs configuration

docs setLogLevel

希望、幸運を!

を編集します。 1.6、あなたは私が、残念ながらそれをテストしていないhere

logger = sc._jvm.org.apache.log4j 
logger.LogManager.getLogger("org"). setLevel(logger.Level.OFF) 
# or 
logger.LogManager.getRootLogger().setLevel(logger.Level.OFF) 

から取られた以下のようなものを試すことができ、それが動作するかどうか私に教えてください。

+0

私はSparkSessionをサポートしていないspark 1.6に取り組んでいます:(他の解決策を提案できますか? –

+0

@eiram_maheraは答えを編集しました。 – mkaran

関連する問題