This is an automated email from the ASF dual-hosted git repository.

stack pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.4 by this push:
     new 3234154  HBASE-25558:Adding audit log for execMasterService (#3101)
3234154 is described below

commit 3234154689d78e530967796f58440e490a1a1028
Author: lujiefsi <lujie...@foxmail.com>
AuthorDate: Thu Apr 1 07:12:31 2021 +0800

    HBASE-25558:Adding audit log for execMasterService (#3101)
    
    Signed-off-by: stack <st...@apache.org>
---
 .../main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java
index 9f7974e..963997a 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java
@@ -930,6 +930,12 @@ public class MasterRpcServices extends RSRpcServices 
implements
       if (execController.getFailedOn() != null) {
         throw execController.getFailedOn();
       }
+
+      String remoteAddress = 
RpcServer.getRemoteAddress().map(InetAddress::toString).orElse("");
+      User caller = RpcServer.getRequestUser().orElse(null);
+      AUDITLOG.info("User {} (remote address: {}) master service request for 
{}.{}", caller,
+        remoteAddress, serviceName, methodName);
+
       return CoprocessorRpcUtils.getResponse(execResult, 
HConstants.EMPTY_BYTE_ARRAY);
     } catch (IOException ie) {
       throw new ServiceException(ie);

Reply via email to