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 GitHub
parent 024248994f
commit e14ec57eee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -963,6 +963,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);