diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java index 565549a2c4bad5f9c7b1f8d5d20f78ef2b947758..01e881ba4b0e15ffe400298586a06d35e6eec719 100644 --- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java @@ -403,7 +403,7 @@ private void notifyMetaListenersOnShutDown() { notifyMetaListeners(key, oldVal, currVal); } } - logInfo("Meta listeners shutdown notification completed."); + logAndAudit("Meta listeners shutdown notification completed."); } catch (MetaException e) { LOG.error("Failed to notify meta listeners on shutdown: ", e); } @@ -872,14 +872,14 @@ private void addAdminUsers_core() throws MetaException { } } - private static void logInfo(String m) { - LOG.info(threadLocalId.get().toString() + ": " + m); + private static void logAndAudit(String m) { + LOG.debug("{}: {}", threadLocalId.get(), m); logAuditEvent(m); } private String startFunction(String function, String extraLogInfo) { incrementCounter(function); - logInfo((getThreadLocalIpAddress() == null ? "" : "source:" + getThreadLocalIpAddress() + " ") + + logAndAudit((getThreadLocalIpAddress() == null ? "" : "source:" + getThreadLocalIpAddress() + " ") + function + extraLogInfo); com.codahale.metrics.Timer timer = Metrics.getOrCreateTimer(MetricsConstants.API_PREFIX + function); @@ -3215,7 +3215,7 @@ public boolean equals(Object obj) { private List add_partitions_core(final RawStore ms, String catName, String dbName, String tblName, List parts, final boolean ifNotExists) throws TException { - logInfo("add_partitions"); + logAndAudit("add_partitions"); boolean success = false; // Ensures that the list doesn't have dups, and keeps track of directories we have created. final Map addedPartitions = new ConcurrentHashMap<>(); @@ -3447,7 +3447,7 @@ public int add_partitions(final List parts) throws MetaException, @Override public int add_partitions_pspec(final List partSpecs) throws TException { - logInfo("add_partitions_pspec"); + logAndAudit("add_partitions_pspec"); if (partSpecs.isEmpty()) { return 0; @@ -8890,7 +8890,7 @@ private static void cleanupRawStore() { try { RawStore rs = HMSHandler.getRawStore(); if (rs != null) { - HMSHandler.logInfo("Cleaning up thread local RawStore..."); + HMSHandler.logAndAudit("Cleaning up thread local RawStore..."); rs.shutdown(); } } finally { @@ -8902,7 +8902,7 @@ private static void cleanupRawStore() { HMSHandler.threadLocalConf.remove(); HMSHandler.threadLocalModifiedConfig.remove(); HMSHandler.removeRawStore(); - HMSHandler.logInfo("Done cleaning up thread local RawStore"); + HMSHandler.logAndAudit("Done cleaning up thread local RawStore"); } }