diff options
author | Patrick Wendell <pwendell@gmail.com> | 2014-01-07 12:42:19 -0800 |
---|---|---|
committer | Patrick Wendell <pwendell@gmail.com> | 2014-01-07 12:56:24 -0800 |
commit | e688e11206401850a13a87d7db52941cc716f88a (patch) | |
tree | 890582f5f577909e2fdd0463fb9726e51a014af6 /core/src | |
parent | 15d953450167c4ec45c9d0a2c7ab8ee71be2e576 (diff) | |
download | spark-e688e11206401850a13a87d7db52941cc716f88a.tar.gz spark-e688e11206401850a13a87d7db52941cc716f88a.tar.bz2 spark-e688e11206401850a13a87d7db52941cc716f88a.zip |
Add log4j exclusion rule to maven.
To make this work I had to rename the defaults file. Otherwise
maven's pattern matching rules included it when trying to match
other log4j.properties files.
I also fixed a bug in the existing maven build where two
<transformers> tags were present in assembly/pom.xml
such that one overwrote the other.
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/resources/org/apache/spark/log4j-defaults.properties (renamed from core/src/main/resources/org/apache/spark/default-log4j.properties) | 0 | ||||
-rw-r--r-- | core/src/main/scala/org/apache/spark/Logging.scala | 10 |
2 files changed, 6 insertions, 4 deletions
diff --git a/core/src/main/resources/org/apache/spark/default-log4j.properties b/core/src/main/resources/org/apache/spark/log4j-defaults.properties index d72dbadc39..d72dbadc39 100644 --- a/core/src/main/resources/org/apache/spark/default-log4j.properties +++ b/core/src/main/resources/org/apache/spark/log4j-defaults.properties diff --git a/core/src/main/scala/org/apache/spark/Logging.scala b/core/src/main/scala/org/apache/spark/Logging.scala index d519fc5a29..4a34989e50 100644 --- a/core/src/main/scala/org/apache/spark/Logging.scala +++ b/core/src/main/scala/org/apache/spark/Logging.scala @@ -104,13 +104,15 @@ trait Logging { // If Log4j doesn't seem initialized, load a default properties file val log4jInitialized = LogManager.getRootLogger.getAllAppenders.hasMoreElements if (!log4jInitialized) { - val defaultLogProps = "org/apache/spark/default-log4j.properties" + val defaultLogProps = "org/apache/spark/log4j-defaults.properties" val classLoader = this.getClass.getClassLoader Option(classLoader.getResource(defaultLogProps)) match { - case Some(url) => PropertyConfigurator.configure(url) - case None => System.err.println(s"Spark was unable to load $defaultLogProps") + case Some(url) => + PropertyConfigurator.configure(url) + log.info(s"Using Spark's default log4j profile: $defaultLogProps") + case None => + System.err.println(s"Spark was unable to load $defaultLogProps") } - log.info(s"Using Spark's default log4j profile: $defaultLogProps") } Logging.initialized = true |