sarutak commented on a change in pull request #35080:
URL: https://github.com/apache/spark/pull/35080#discussion_r778477260
##########
File path: core/src/main/scala/org/apache/spark/internal/Logging.scala
##########
@@ -259,18 +259,25 @@ private[spark] object Logging {
} else if
(logEvent.getLevel.isMoreSpecificThan(Logging.sparkShellThresholdLevel)) {
Filter.Result.NEUTRAL
} else {
- var logger = LogManager.getLogger(logEvent.getLoggerName)
- .asInstanceOf[Log4jLogger]
- while (logger.getParent() != null) {
- if (logger.getLevel != null || !logger.getAppenders.isEmpty) {
+ val logger =
LogManager.getLogger(logEvent.getLoggerName).asInstanceOf[Log4jLogger]
+ if (loggerWithCustomConfig(logger)) {
return Filter.Result.NEUTRAL
- }
- logger = logger.getParent()
}
Filter.Result.DENY
}
}
+ // Return true if the logger has custom configuration. It depends on:
+ // 1. If the logger isn't attached with root logger config (i.e., with
custom configuration), or
+ // 2. the logger level is different to root config level (i.e., it is
changed programmingly).
+ //
+ // Note that if a logger is programmingly changed log level but set to
same level as root config
Review comment:
Thank you for the explanation. I got it.
--
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]