diff --git a/spring-cloud-netflix-eureka-server/src/main/java/org/springframework/cloud/netflix/eureka/server/InstanceRegistry.java b/spring-cloud-netflix-eureka-server/src/main/java/org/springframework/cloud/netflix/eureka/server/InstanceRegistry.java index e6c44d2d..cd21a8c6 100644 --- a/spring-cloud-netflix-eureka-server/src/main/java/org/springframework/cloud/netflix/eureka/server/InstanceRegistry.java +++ b/spring-cloud-netflix-eureka-server/src/main/java/org/springframework/cloud/netflix/eureka/server/InstanceRegistry.java @@ -81,8 +81,10 @@ public class InstanceRegistry extends PeerAwareInstanceRegistryImpl implements A @Override public void register(InstanceInfo info, int leaseDuration, boolean isReplication) { - log.debug("register " + info.getAppName() + ", vip " + info.getVIPAddress() - + ", leaseDuration " + leaseDuration + ", isReplication " + isReplication); + if (log.isDebugEnabled()) { + log.debug("register " + info.getAppName() + ", vip " + info.getVIPAddress() + + ", leaseDuration " + leaseDuration + ", isReplication " + isReplication); + } // TODO: what to publish from info (whole object?) this.ctxt.publishEvent(new EurekaInstanceRegisteredEvent(this, info, leaseDuration, isReplication)); @@ -92,8 +94,10 @@ public class InstanceRegistry extends PeerAwareInstanceRegistryImpl implements A @Override public boolean cancel(String appName, String serverId, boolean isReplication) { - log.debug("cancel " + appName + " serverId " + serverId + ", isReplication {}" - + isReplication); + if (log.isDebugEnabled()) { + log.debug("cancel " + appName + " serverId " + serverId + ", isReplication {}" + + isReplication); + } this.ctxt.publishEvent(new EurekaInstanceCanceledEvent(this, appName, serverId, isReplication)); @@ -103,8 +107,10 @@ public class InstanceRegistry extends PeerAwareInstanceRegistryImpl implements A @Override public boolean renew(final String appName, final String serverId, boolean isReplication) { - log.debug("renew " + appName + " serverId " + serverId + ", isReplication {}" - + isReplication); + if (log.isDebugEnabled()) { + log.debug("renew " + appName + " serverId " + serverId + ", isReplication {}" + + isReplication); + } List applications = getSortedApplications(); for (Application input : applications) { if (input.getName().equals(appName)) {