iodone commented on a change in pull request #1853:
URL: https://github.com/apache/incubator-kyuubi/pull/1853#discussion_r837195305



##########
File path: 
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala
##########
@@ -170,15 +169,37 @@ object SparkSQLEngine extends Logging {
           kyuubiConf)
         val event = EngineEvent(engine)
         info(event)
-        EventLogging.onEvent(event)
+        EventBus.post(event)
       } catch {
         case t: Throwable =>
           throw new KyuubiException(s"Failed to start SparkSQLEngine: 
${t.getMessage}", t)
       }
       // Stop engine before SparkContext stopped to avoid calling a stopped 
SparkContext
       addShutdownHook(() => engine.stop(), SPARK_CONTEXT_SHUTDOWN_PRIORITY + 2)
-      addShutdownHook(() => eventLogging.stop(), 
SPARK_CONTEXT_SHUTDOWN_PRIORITY + 1)
     }
+
+    def initLoggerEventHandler(conf: KyuubiConf): Unit = {
+      conf.get(ENGINE_EVENT_LOGGERS)
+        .map(EventLoggerType.withName)
+        .foreach {
+          case EventLoggerType.SPARK =>
+            EventBus.register[KyuubiEvent](new 
SparkHistoryLoggingEventHandler(spark.sparkContext))
+          case EventLoggerType.JSON =>
+            val handler = SparkJsonLoggingEventHandler(
+              
spark.sparkContext.applicationAttemptId.getOrElse(spark.sparkContext.applicationId),

Review comment:
       Thanks, i will resolve it ASAP




-- 
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