From 229040a463da2dc363ec75906aeea544109a7bb8 Mon Sep 17 00:00:00 2001 From: Tony Clarke Date: Fri, 18 Jan 2019 14:23:09 -0500 Subject: [PATCH] Add logging for routes loaded by gatewy properties --- .../cloud/gateway/config/GatewayProperties.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/config/GatewayProperties.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/config/GatewayProperties.java index 546e360c..93dcd1b9 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/config/GatewayProperties.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/config/GatewayProperties.java @@ -24,6 +24,8 @@ import java.util.List; import javax.validation.Valid; import javax.validation.constraints.NotNull; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.cloud.gateway.filter.FilterDefinition; import org.springframework.cloud.gateway.route.RouteDefinition; @@ -37,6 +39,7 @@ import org.springframework.validation.annotation.Validated; @Validated public class GatewayProperties { + private final Log logger = LogFactory.getLog(getClass()); /** * List of Routes */ @@ -56,8 +59,12 @@ public class GatewayProperties { return routes; } + public void setRoutes(List routes) { this.routes = routes; + if (routes != null && routes.size() > 0 && logger.isDebugEnabled()) { + logger.debug("Routes supplied from Gateway Properties: "+routes); + } } public List getDefaultFilters() {