vanzin commented on a change in pull request #26798: [SPARK-30167][REPL] Log4j
configuration for REPL can't override the root logger properly.
URL: https://github.com/apache/spark/pull/26798#discussion_r357855537
##########
File path: core/src/main/scala/org/apache/spark/internal/Logging.scala
##########
@@ -230,19 +235,18 @@ private class SparkShellLoggingFilter extends Filter {
*/
def decide(loggingEvent: LoggingEvent): Int = {
if (Logging.sparkShellThresholdLevel == null) {
- return Filter.NEUTRAL
- }
- val rootLevel = LogManager.getRootLogger().getLevel()
- if (!loggingEvent.getLevel().eq(rootLevel)) {
- return Filter.NEUTRAL
- }
- var logger = loggingEvent.getLogger()
- while (logger.getParent() != null) {
- if (logger.getLevel() != null) {
- return Filter.NEUTRAL
+ Filter.NEUTRAL
+ } else if
(loggingEvent.getLevel.isGreaterOrEqual(Logging.sparkShellThresholdLevel)) {
+ Filter.NEUTRAL
+ } else {
+ var logger = loggingEvent.getLogger()
+ while (logger.getParent() != null) {
+ if (logger.getLevel != null || logger.getAllAppenders.hasMoreElements)
{
Review comment:
Ok, i tested again and the culprit is the line that does `if
(!loggingEvent.getLevel().eq(rootLevel))`. which is what your updated
description says. So all's good.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]