From 398c31727fa848651f37f5f3e0c6da139d3e19cb Mon Sep 17 00:00:00 2001 From: wangjx <1609724385@qq.com> Date: Thu, 24 Jun 2021 21:30:09 +0800 Subject: [PATCH] =?UTF-8?q?nacos=E6=8C=81=E4=B9=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../discovery/SimpleMachineDiscovery.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/SimpleMachineDiscovery.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/SimpleMachineDiscovery.java index a21fc355..140cfcd7 100755 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/SimpleMachineDiscovery.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/SimpleMachineDiscovery.java @@ -24,16 +24,20 @@ import java.util.concurrent.ConcurrentMap; import com.alibaba.csp.sentinel.util.AssertUtil; -import lombok.extern.log4j.Log4j; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** * @author leyou */ -@Log4j @Component public class SimpleMachineDiscovery implements MachineDiscovery { + @Autowired + private static Logger logger = LoggerFactory.getLogger(SimpleMachineDiscovery.class); private final ConcurrentMap apps = new ConcurrentHashMap<>(); @Override @@ -46,7 +50,7 @@ public class SimpleMachineDiscovery implements MachineDiscovery { @Override public boolean removeMachine(String app, String ip, int port) { - log.debug("app is " + app); + logger.info("app is " + app); AssertUtil.assertNotBlank(app, "app name cannot be blank"); AppInfo appInfo = apps.get(app); if (appInfo != null) { @@ -59,20 +63,20 @@ public class SimpleMachineDiscovery implements MachineDiscovery { public List getAppNames() { - log.debug("apps.keySet is " + apps.keySet()); + logger.info("apps.keySet is " + apps.keySet()); return new ArrayList<>(apps.keySet()); } @Override public AppInfo getDetailApp(String app) { - log.debug("app is " + app); + logger.info("app is " + app); AssertUtil.assertNotBlank(app, "app name cannot be blank"); return apps.get(app); } @Override public Set getBriefApps() { - log.debug("apps is " + apps.toString()); + logger.info("apps is " + apps.toString()); return new HashSet<>(apps.values()); }