You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/02/14 11:41:44 UTC

[GitHub] [incubator-kyuubi] cfmcgrady commented on a change in pull request #1907: [KYUUBI #1905] log4j2-defaults.properties is not working since log4j 2 is always intialized by default

cfmcgrady commented on a change in pull request #1907:
URL: https://github.com/apache/incubator-kyuubi/pull/1907#discussion_r805759049



##########
File path: kyuubi-common/src/main/scala/org/apache/kyuubi/Logging.scala
##########
@@ -92,16 +93,15 @@ trait Logging {
 
   private def initializeLogging(isInterpreter: Boolean): Unit = {
     if (Logging.isLog4j2) {
-      val log4j2Initialized = !LogManager.getRootLogger
-        .asInstanceOf[org.apache.logging.log4j.core.Logger].getAppenders.isEmpty
       // scalastyle:off println
-      if (!log4j2Initialized) {
+      if (Logging.islog4j2DefaultConfigured()) {
         Logging.useDefault = true
         val defaultLogProps = "log4j2-defaults.properties"
         Option(Thread.currentThread().getContextClassLoader.getResource(defaultLogProps)) match {
           case Some(url) =>
             val context = LogManager.getContext(false).asInstanceOf[LoggerContext]
             context.setConfigLocation(url.toURI)
+            System.err.println(s"Using Kyuubi's default log4j profile: $url")

Review comment:
       Only for debug, it's ok for me to revert.




-- 
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: commits-unsubscribe@kyuubi.apache.org

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