Github user pwendell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1547#discussion_r15510992
  
    --- Diff: core/src/main/scala/org/apache/spark/Logging.scala ---
    @@ -110,23 +110,26 @@ 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")
    -    val log4jInitialized = 
LogManager.getRootLogger.getAllAppenders.hasMoreElements
    -    if (!log4jInitialized && usingLog4j) {
    +    // If Log4j 1.2 is being used, but is not initialized, load a default 
properties file
    +    val binderClass = 
StaticLoggerBinder.getSingleton.getLoggerFactoryClassStr
    +    // This minimally distinguishes the log4j 1.2 binding, currently
    +    // org.slf4j.impl.Log4jLoggerFactory, from the log4j 2.0 binding, 
currently
    +    // org.apache.logging.slf4j.Log4jLoggerFactory
    +    val usingLog4j12 =
    +      binderClass.endsWith("Log4jLoggerFactory") && 
binderClass.startsWith("org.slf4j.")
    --- End diff --
    
    just wondering - what is the advantage here over just checking for 
`org.slf4j.impl.Log4jLoggerFactory`? I think this class name is table in all 
1.X releases... is the concern to guard against them changing it?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to