You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/01/01 03:16:01 UTC

[GitHub] [spark] viirya commented on a change in pull request #35080: [SPARK-37792][CORE] Fix the check of custom configuration in SparkShellLoggingFilter

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



##########
File path: core/src/test/scala/org/apache/spark/internal/LoggingSuite.scala
##########
@@ -36,26 +36,27 @@ class LoggingSuite extends SparkFunSuite {
     val originalThreshold = Logging.sparkShellThresholdLevel
     Logging.sparkShellThresholdLevel = Level.WARN
     try {
+      // without custom log level configured
       val logger1 = LogManager.getLogger("a.b.c.D")
         .asInstanceOf[Logger]
       val logEvent1 = new Builder().setLevel(Level.INFO)
         .setLoggerName(logger1.getName()).setMessage(new SimpleMessage("Test")).build()
-      // Logger's default level is not null in log4j2, and cannot be set to null too.
-      assert(ssf.filter(logEvent1) == Filter.Result.NEUTRAL)
+      assert(ssf.filter(logEvent1) == Filter.Result.DENY)
 
-      // custom log level configured
-      val parentLogger = LogManager.getLogger("a.b.c")
+      // custom log level configured (see log4j2.properties)
+      val jettyLogger = LogManager.getLogger("org.sparkproject.jetty")
         .asInstanceOf[Logger]
-      parentLogger.setLevel(Level.INFO)

Review comment:
       The change of logger level doesn't change its `LoggerConfig`. 
   
   For example, when we require the logger `a.b.c`, because we don't configure it in the current properties file, it will use root `LoggerConfig`.
   




-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org