HyukjinKwon commented on a change in pull request #35080:
URL: https://github.com/apache/spark/pull/35080#discussion_r776977561



##########
File path: core/src/main/scala/org/apache/spark/internal/Logging.scala
##########
@@ -266,6 +266,10 @@ private[spark] object Logging {
       }
     }
 
+    private def loggerWithoutConfig(logger: Log4jLogger): Boolean = {

Review comment:
       For some reasons, `logger.getLevel` was `null`, and 
`logger.getAppenders` was empty in Log4J by default. I guess that it was only 
explicitly set when specified assuming from 
https://github.com/apache/spark/commit/61ebc8118665531b4c11a31f2b3d459dd201b097 
(?). cc @sarutak.
   
   After Log4J upgrade, `logger.getLevel` is set, for example, `INFO` and 
`logger.getAppenders` contains `STDOUT` presumably set from 
https://github.com/apache/spark/blob/ca5cabe5fbffdf02b51da2fd576ae8dc6d5b5909/core/src/main/resources/org/apache/spark/log4j2-defaults.properties#L23
 (?).
   
   I was wondering if we do something like:
   
   ```diff
   - !logger.getAppenders.isEmpty
   + logger.getAppenders.asScala.find(_._1 != "STDOUT").isDefined
   ```
   
   But not sure if this would catch all the details. I haven't closely followed 
up Log4J migration fixes so I might be wrong somewhere.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to