HBASE-25558:Adding audit log for execMasterService (#3101)

Signed-off-by: stack <stack@apache.org>
This commit is contained in:
lujiefsi 2021-04-01 07:12:31 +08:00 committed by stack
parent 6f4ab4a134
commit 3234154689
1 changed files with 6 additions and 0 deletions

View File

@ -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);