Skip to content

Commit

Permalink
Revert "Merge pull request apache#560 from pwendell/logging. Closes a…
Browse files Browse the repository at this point in the history
…pache#560."

This reverts commit b6d40b7.
  • Loading branch information
pwendell committed Feb 10, 2014
1 parent 919bd7f commit d6a9bdc
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions core/src/main/scala/org/apache/spark/Logging.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit d6a9bdc

Please sign in to comment.