从 pyspark 记录
Logging from pyspark
在这个问题 How to turn off INFO logging in PySpark? 中找到的有关来自 pyspark 的日志记录的信息对我不起作用:日志记录没有发生。
我熟悉从本地构建的 spark 中设置登录 pyspark。但是,我现在正在使用 cloudera spark。我在
中设置了一个 RollingFileAppender
$SPARK_HOME/log4j.properties
根据文档,这是正确的做法:
http://spark.apache.org/docs/1.2.0/configuration.html#configuring-logging
Configuring Logging
Spark uses log4j for logging. You can configure it by adding a
log4j.properties file in the conf directory. One way to start is to
copy the existing log4j.properties.template located there.
但这没有生效:没有在目标目录中创建日志文件。
具体问题似乎是由于 Zookeeper 库之一没有使用 SPARK_HOME 提供的 log4j.properties 设置。相反,ZK 在类路径
上选择第一个 log4j.properties
解决方案是将 $SPARK_HOME/conf 目录中的 log4j.properties 复制到 $HADOOP_CONF_DIR。然后日志记录按预期运行。
在这个问题 How to turn off INFO logging in PySpark? 中找到的有关来自 pyspark 的日志记录的信息对我不起作用:日志记录没有发生。
我熟悉从本地构建的 spark 中设置登录 pyspark。但是,我现在正在使用 cloudera spark。我在
中设置了一个 RollingFileAppender$SPARK_HOME/log4j.properties
根据文档,这是正确的做法:
http://spark.apache.org/docs/1.2.0/configuration.html#configuring-logging
Configuring Logging Spark uses log4j for logging. You can configure it by adding a
log4j.properties file in the conf directory. One way to start is to copy the existing log4j.properties.template located there.
但这没有生效:没有在目标目录中创建日志文件。
具体问题似乎是由于 Zookeeper 库之一没有使用 SPARK_HOME 提供的 log4j.properties 设置。相反,ZK 在类路径
上选择第一个 log4j.properties解决方案是将 $SPARK_HOME/conf 目录中的 log4j.properties 复制到 $HADOOP_CONF_DIR。然后日志记录按预期运行。