This is an automated email from the ASF dual-hosted git repository.

iluo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git


The following commit(s) were added to refs/heads/master by this push:
     new d4d6dbf  add log in ZkclientZookeeperClient.java (#3109)
d4d6dbf is described below

commit d4d6dbfa361173fbaa7240efbfec6ba248ca0f31
Author: huazhongming <[email protected]>
AuthorDate: Wed Jan 2 10:54:55 2019 +0800

    add log in ZkclientZookeeperClient.java (#3109)
---
 .../zookeeper/zkclient/ZkclientZookeeperClient.java        | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git 
a/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/org/apache/dubbo/remoting/zookeeper/zkclient/ZkclientZookeeperClient.java
 
b/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/org/apache/dubbo/remoting/zookeeper/zkclient/ZkclientZookeeperClient.java
index 24a38cd..2133952 100644
--- 
a/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/org/apache/dubbo/remoting/zookeeper/zkclient/ZkclientZookeeperClient.java
+++ 
b/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/org/apache/dubbo/remoting/zookeeper/zkclient/ZkclientZookeeperClient.java
@@ -18,6 +18,8 @@ package org.apache.dubbo.remoting.zookeeper.zkclient;
 
 import org.apache.dubbo.common.Constants;
 import org.apache.dubbo.common.URL;
+import org.apache.dubbo.common.logger.Logger;
+import org.apache.dubbo.common.logger.LoggerFactory;
 import org.apache.dubbo.remoting.zookeeper.ChildListener;
 import org.apache.dubbo.remoting.zookeeper.StateListener;
 import org.apache.dubbo.remoting.zookeeper.support.AbstractZookeeperClient;
@@ -32,6 +34,8 @@ import java.util.List;
 
 public class ZkclientZookeeperClient extends 
AbstractZookeeperClient<IZkChildListener> {
 
+    private Logger logger = 
LoggerFactory.getLogger(ZkclientZookeeperClient.class);
+
     private final ZkClientWrapper client;
 
     private volatile KeeperState state = KeeperState.SyncConnected;
@@ -65,6 +69,7 @@ public class ZkclientZookeeperClient extends 
AbstractZookeeperClient<IZkChildLis
         try {
             client.createPersistent(path);
         } catch (ZkNodeExistsException e) {
+            logger.error("zookeeper failed to create persistent node with " + 
path + ": ", e);
         }
     }
 
@@ -73,6 +78,7 @@ public class ZkclientZookeeperClient extends 
AbstractZookeeperClient<IZkChildLis
         try {
             client.createEphemeral(path);
         } catch (ZkNodeExistsException e) {
+            logger.error("zookeeper failed to create ephemeral node with " + 
path + ": ", e);
         }
     }
 
@@ -81,6 +87,8 @@ public class ZkclientZookeeperClient extends 
AbstractZookeeperClient<IZkChildLis
         try {
             client.createPersistent(path, data);
         } catch (ZkNodeExistsException e) {
+            logger.error("zookeeper failed to create persistent node with " +
+                    path + " and " + data + " : ", e);
         }
     }
 
@@ -89,6 +97,8 @@ public class ZkclientZookeeperClient extends 
AbstractZookeeperClient<IZkChildLis
         try {
             client.createEphemeral(path, data);
         } catch (ZkNodeExistsException e) {
+            logger.error("zookeeper failed to create ephemeral node with " +
+                    path + " and " + data + " : ", e);
         }
     }
 
@@ -97,6 +107,7 @@ public class ZkclientZookeeperClient extends 
AbstractZookeeperClient<IZkChildLis
         try {
             client.delete(path);
         } catch (ZkNoNodeException e) {
+            logger.error("zookeeper failed to delete node with " + path + ": 
", e);
         }
     }
 
@@ -105,6 +116,7 @@ public class ZkclientZookeeperClient extends 
AbstractZookeeperClient<IZkChildLis
         try {
             return client.getChildren(path);
         } catch (ZkNoNodeException e) {
+            logger.error("zookeeper failed to get children node with " + path 
+ ": ", e);
             return null;
         }
     }
@@ -114,6 +126,7 @@ public class ZkclientZookeeperClient extends 
AbstractZookeeperClient<IZkChildLis
         try {
             return client.exists(path);
         } catch (Throwable t) {
+            logger.error("zookeeper failed to check node existing with " + 
path + ": ", t);
         }
         return false;
     }
@@ -128,6 +141,7 @@ public class ZkclientZookeeperClient extends 
AbstractZookeeperClient<IZkChildLis
         try {
             return client.getData(path);
         } catch (ZkNoNodeException e) {
+            logger.error("zookeeper failed to get data with " + path + ": ", 
e);
             return null;
         }
     }

Reply via email to