incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [2/4] git commit: Removing the setUser from the log because the user is captured in the following request.
Date Sat, 22 Mar 2014 21:01:03 GMT
Removing the setUser from the log because the user is captured in the following request.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/08c2c529
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/08c2c529
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/08c2c529

Branch: refs/heads/apache-blur-0.2
Commit: 08c2c529d3a82c931c68b1965e93e4460beec95b
Parents: eda29d7
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Sat Mar 22 11:34:22 2014 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Sat Mar 22 11:34:22 2014 -0400

----------------------------------------------------------------------
 .../src/main/java/org/apache/blur/utils/BlurUtil.java   | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/08c2c529/blur-core/src/main/java/org/apache/blur/utils/BlurUtil.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/utils/BlurUtil.java b/blur-core/src/main/java/org/apache/blur/utils/BlurUtil.java
index e2778f8..9a3cf78 100644
--- a/blur-core/src/main/java/org/apache/blur/utils/BlurUtil.java
+++ b/blur-core/src/main/java/org/apache/blur/utils/BlurUtil.java
@@ -244,8 +244,9 @@ public class BlurUtil {
         Tracer trace = Trace.trace("thrift recv", Trace.param("method", method.getName()),
             Trace.param("connection", tracingConnectionString));
         User user = UserContext.getUser();
+        boolean notSetUserMethod = isNotSetUserMethod(name);
         try {
-          if (REQUEST_LOG.isInfoEnabled()) {
+          if (REQUEST_LOG.isInfoEnabled() && notSetUserMethod) {
             if (argsStr == null) {
               loggerArgsState = _loggerArgsState.get();
               argsStr = getArgsStr(args, name, loggerArgsState);
@@ -260,7 +261,7 @@ public class BlurUtil {
           trace.done();
           long end = System.nanoTime();
           double ms = (end - start) / 1000000.0;
-          if (RESPONSE_LOG.isInfoEnabled()) {
+          if (RESPONSE_LOG.isInfoEnabled() && notSetUserMethod) {
             if (argsStr == null) {
               if (loggerArgsState == null) {
                 loggerArgsState = _loggerArgsState.get();
@@ -278,6 +279,13 @@ public class BlurUtil {
         }
       }
 
+      private boolean isNotSetUserMethod(String name) {
+        if (name.equals("setUser")) {
+          return false;
+        }
+        return true;
+      }
+
     };
     return (T) Proxy.newProxyInstance(clazz.getClassLoader(), new Class[] { clazz }, handler);
   }


Mime
View raw message