Skip to content
Snippets Groups Projects
Commit d6a9bdc0 authored by Patrick Wendell's avatar Patrick Wendell
Browse files

Revert "Merge pull request #560 from pwendell/logging. Closes #560."

This reverts commit b6d40b78.
parent 919bd7f6
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,6 @@ package org.apache.spark
import org.apache.log4j.{LogManager, PropertyConfigurator}
import org.slf4j.{Logger, LoggerFactory}
import org.slf4j.impl.StaticLoggerBinder
/**
* Utility trait for classes that want to log data. Creates a SLF4J logger for the class and allows
......@@ -102,11 +101,9 @@ trait Logging {
}
private def initializeLogging() {
// If Log4j is being used, but is not initialized, load a default properties file
val binder = StaticLoggerBinder.getSingleton
val usingLog4j = binder.getLoggerFactoryClassStr.endsWith("Log4jLoggerFactory")
// If Log4j doesn't seem initialized, load a default properties file
val log4jInitialized = LogManager.getRootLogger.getAllAppenders.hasMoreElements
if (!log4jInitialized && usingLog4j) {
if (!log4jInitialized) {
val defaultLogProps = "org/apache/spark/log4j-defaults.properties"
val classLoader = this.getClass.getClassLoader
Option(classLoader.getResource(defaultLogProps)) match {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment