gengliangwang commented on code in PR #47275:
URL: https://github.com/apache/spark/pull/47275#discussion_r1671330595


##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SessionHolder.scala:
##########
@@ -248,15 +249,15 @@ case class SessionHolder(userId: String, sessionId: 
String, session: SparkSessio
   private[connect] def updateAccessTime(): Unit = {
     lastAccessTimeMs = System.currentTimeMillis()
     logInfo(
-      log"Session ${MDC(SESSION_KEY, key)} accessed, " +
-        log"time ${MDC(LAST_ACCESS_TIME, lastAccessTimeMs)} ms.")
+      log"Session ${MDC(LogKeys.SESSION_KEY, key)} accessed, " +

Review Comment:
   The key contains user id and session id. Let's follow the style of the other 
entry:
   ```
   session with userId: ${MDC(LogKeys.USER_ID, userId)} and " +
         log"sessionId: ${MDC(LogKeys.SESSION_ID, sessionId)
   ```



##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SessionHolder.scala:
##########
@@ -248,15 +249,15 @@ case class SessionHolder(userId: String, sessionId: 
String, session: SparkSessio
   private[connect] def updateAccessTime(): Unit = {
     lastAccessTimeMs = System.currentTimeMillis()
     logInfo(
-      log"Session ${MDC(SESSION_KEY, key)} accessed, " +
-        log"time ${MDC(LAST_ACCESS_TIME, lastAccessTimeMs)} ms.")
+      log"Session ${MDC(LogKeys.SESSION_KEY, key)} accessed, " +
+      log"time ${MDC(LogKeys.LAST_ACCESS_TIME, lastAccessTimeMs)} ms.")
   }
 
   private[connect] def setCustomInactiveTimeoutMs(newInactiveTimeoutMs: 
Option[Long]): Unit = {
     customInactiveTimeoutMs = newInactiveTimeoutMs
     logInfo(
-      log"Session ${MDC(SESSION_KEY, key)} " +
-        log"inactive timeout set to ${MDC(TIMEOUT, customInactiveTimeoutMs)} 
ms.")
+      log"Session ${MDC(LogKeys.SESSION_KEY, key)} " +

Review Comment:
   ditto



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