Commit 208117bd by Igor Kryvenko Committed by Spencer Gibb

hotfix/add-log-ribbon (#2619)

* Add logging to RibbonLoadBalancerRetryPolicy
parent db66e1c3
......@@ -19,6 +19,8 @@ package org.springframework.cloud.netflix.ribbon;
import com.netflix.client.config.CommonClientConfigKey;
import com.netflix.client.config.IClientConfig;
import com.netflix.client.config.IClientConfigKey;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.cloud.client.loadbalancer.LoadBalancedRetryContext;
import org.springframework.cloud.client.loadbalancer.LoadBalancedRetryPolicy;
import org.springframework.cloud.client.loadbalancer.ServiceInstanceChooser;
......@@ -35,6 +37,7 @@ import java.util.List;
public class RibbonLoadBalancedRetryPolicy implements LoadBalancedRetryPolicy {
public static final IClientConfigKey<String> RETRYABLE_STATUS_CODES = new CommonClientConfigKey<String>("retryableStatusCodes") {};
private static final Log log = LogFactory.getLog(RibbonLoadBalancedRetryPolicy.class);
private int sameServerCount = 0;
private int nextServerCount = 0;
private String serviceId;
......@@ -60,7 +63,7 @@ public class RibbonLoadBalancedRetryPolicy implements LoadBalancedRetryPolicy {
try {
retryableStatusCodes.add(Integer.valueOf(code.trim()));
} catch (NumberFormatException e) {
//TODO log
log.warn("We cant add the status code because the code [ " + code + " ] could not be converted to an integer. ", e);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment