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



##########
File path: core/src/main/scala/org/apache/spark/util/Utils.scala
##########
@@ -2423,9 +2423,11 @@ private[spark] object Utils extends Logging {
   /**
    * configure a new log4j level
    */
-  def setLogLevel(l: org.apache.log4j.Level): Unit = {
-    val rootLogger = org.apache.log4j.Logger.getRootLogger()
+  def setLogLevel(l: org.apache.logging.log4j.Level): Unit = {
+    val rootLogger = org.apache.logging.log4j.LogManager.getRootLogger()
+      .asInstanceOf[org.apache.logging.log4j.core.Logger]
     rootLogger.setLevel(l)
+    rootLogger.get().setLevel(l)

Review comment:
       Hmm, this is a good question. I think I feel the same regarding log4j2 
API. This is the way I finally made it work. I will look if there is more 
proper way for 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]

Reply via email to