accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [1/3] accumulo git commit: ACCUMULO-3395 Keep a reference to a single Logger instance.
Date Tue, 09 Dec 2014 18:15:38 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.6 6170c02ee -> 98c524e34
  refs/heads/master de1d3ee38 -> 04774b171


ACCUMULO-3395 Keep a reference to a single Logger instance.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/98c524e3
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/98c524e3
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/98c524e3

Branch: refs/heads/1.6
Commit: 98c524e3425678286872952ce376a4aa774079a5
Parents: 6170c02
Author: Josh Elser <elserj@apache.org>
Authored: Tue Dec 9 13:11:03 2014 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Tue Dec 9 13:11:03 2014 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/accumulo/server/util/RpcWrapper.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/98c524e3/server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java b/server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java
index 02bd1ef..7055053 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java
@@ -24,6 +24,7 @@ import org.apache.accumulo.trace.instrument.thrift.RpcServerInvocationHandler;
 import org.apache.accumulo.trace.instrument.thrift.TraceWrap;
 import org.apache.thrift.TApplicationException;
 import org.apache.thrift.TException;
+import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
@@ -38,17 +39,18 @@ public class RpcWrapper {
 
   public static <T> T service(final T instance) {
     InvocationHandler handler = new RpcServerInvocationHandler<T>(instance) {
+      private final Logger log = LoggerFactory.getLogger(instance.getClass());
       @Override
       public Object invoke(Object obj, Method method, Object[] args) throws Throwable {
         try {
           return super.invoke(obj, method, args);
         } catch (RuntimeException e) {
           String msg = e.getMessage();
-          LoggerFactory.getLogger(instance.getClass()).error(msg, e);
+          log.error(msg, e);
           throw new TException(msg);
         } catch (Error e) {
           String msg = e.getMessage();
-          LoggerFactory.getLogger(instance.getClass()).error(msg, e);
+          log.error(msg, e);
           throw new TException(msg);
         }
       }


Mime
View raw message