瀏覽代碼

merge -c 1525626 FIXES: HDFS-5240. Separate formatting from logging in the audit logger API (daryn)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1525627 13f79535-47bb-0310-9956-ffa450edef68
Daryn Sharp 11 年之前
父節點
當前提交
fa0ecb7567

+ 2 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -48,6 +48,8 @@ Release 2.3.0 - UNRELEASED
     and the excludedNodes parameter types respectively to Node and Set.
     (Junping Du via szetszwo)
 
+    HDFS-5240. Separate formatting from logging in the audit logger API (daryn)
+
   OPTIMIZATIONS
 
     HDFS-5239.  Allow FSNamesystem lock fairness to be configurable (daryn)

+ 4 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

@@ -6873,10 +6873,13 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
           }
           sb.append(trackingId);
         }
-        auditLog.info(sb);
+        logAuditMessage(sb.toString());
       }
     }
 
+    public void logAuditMessage(String message) {
+      auditLog.info(message);
+    }
   }
 
 }