hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1370005 - /hbase/branches/0.94/security/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
Date Mon, 06 Aug 2012 20:48:19 GMT
Author: stack
Date: Mon Aug  6 20:48:19 2012
New Revision: 1370005

URL: http://svn.apache.org/viewvc?rev=1370005&view=rev
Log:
HBASE-6373 Add more context information to audit log messages

Modified:
    hbase/branches/0.94/security/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java

Modified: hbase/branches/0.94/security/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/security/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java?rev=1370005&r1=1370004&r2=1370005&view=diff
==============================================================================
--- hbase/branches/0.94/security/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
(original)
+++ hbase/branches/0.94/security/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
Mon Aug  6 20:48:19 2012
@@ -15,6 +15,7 @@
 package org.apache.hadoop.hbase.security.access;
 
 import java.io.IOException;
+import java.net.InetAddress;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
@@ -339,9 +340,15 @@ public class AccessController extends Ba
 
   private void logResult(AuthResult result) {
     if (AUDITLOG.isTraceEnabled()) {
+      InetAddress remoteAddr = null;
+      RequestContext ctx = RequestContext.get();
+      if (ctx != null) {
+        remoteAddr = ctx.getRemoteAddress();
+      }
       AUDITLOG.trace("Access " + (result.isAllowed() ? "allowed" : "denied") +
           " for user " + (result.getUser() != null ? result.getUser().getShortName() : "UNKNOWN")
+
           "; reason: " + result.getReason() +
+          "; remote address: " + (remoteAddr != null ? remoteAddr : "") +
           "; context: " + result.toContextString());
     }
   }



Mime
View raw message