maheshk114 commented on a change in pull request #881: HIVE-22733 : After 
disable operation log property in hive, still HS2 saving the operation log
URL: https://github.com/apache/hive/pull/881#discussion_r368354644
 
 

 ##########
 File path: common/src/java/org/apache/hadoop/hive/common/LogUtils.java
 ##########
 @@ -219,18 +219,28 @@ public static String maskIfPassword(String key, String 
value) {
    * Register logging context so that log system can print QueryId, SessionId, 
etc for each message
    */
   public static void registerLoggingContext(Configuration conf) {
-    MDC.put(SESSIONID_LOG_KEY, HiveConf.getVar(conf, 
HiveConf.ConfVars.HIVESESSIONID));
-    MDC.put(QUERYID_LOG_KEY, HiveConf.getVar(conf, 
HiveConf.ConfVars.HIVEQUERYID));
     if (HiveConf.getBoolVar(conf, 
HiveConf.ConfVars.HIVE_SERVER2_LOGGING_OPERATION_ENABLED)) {
+      MDC.put(SESSIONID_LOG_KEY, HiveConf.getVar(conf, 
HiveConf.ConfVars.HIVESESSIONID));
+      MDC.put(QUERYID_LOG_KEY, HiveConf.getVar(conf, 
HiveConf.ConfVars.HIVEQUERYID));
       MDC.put(OPERATIONLOG_LEVEL_KEY, HiveConf.getVar(conf, 
HiveConf.ConfVars.HIVE_SERVER2_LOGGING_OPERATION_LEVEL));
+      l4j.info("Thread context registration is done.");
+    } else {
+      l4j.info("Thread context registration is skipped.");
 
 Review comment:
   i think its required as HIVE-22115 will disable it at init time. This change 
will make sure that its not registered if the operation log is disabled at 
session level.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to