diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java index 0485184..2e13812 100644 --- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java +++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java @@ -418,7 +418,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); } @@ -903,14 +903,14 @@ private void addAdminUsers_core() throws MetaException { } } - private static void logInfo(String m) { - LOG.info(threadLocalId.get().toString() + ": " + m); + private static void logAndAudit(final 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); @@ -3317,7 +3317,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<>(); @@ -3647,7 +3647,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; @@ -9326,7 +9326,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 { @@ -9338,7 +9338,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"); } }