Commit a45c0cce by Spencer Gibb

change printStackTrace to commons log statements

fixes gh-153
parent c31f700b
...@@ -23,6 +23,7 @@ import java.lang.reflect.Type; ...@@ -23,6 +23,7 @@ import java.lang.reflect.Type;
import javax.inject.Provider; import javax.inject.Provider;
import lombok.extern.apachecommons.CommonsLog;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.web.HttpMessageConverters; import org.springframework.boot.autoconfigure.web.HttpMessageConverters;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
...@@ -40,6 +41,7 @@ import static org.springframework.cloud.netflix.feign.FeignUtils.getHttpHeaders; ...@@ -40,6 +41,7 @@ import static org.springframework.cloud.netflix.feign.FeignUtils.getHttpHeaders;
/** /**
* @author Spencer Gibb * @author Spencer Gibb
*/ */
@CommonsLog
public class SpringDecoder implements Decoder { public class SpringDecoder implements Decoder {
@Autowired @Autowired
...@@ -91,7 +93,7 @@ public class SpringDecoder implements Decoder { ...@@ -91,7 +93,7 @@ public class SpringDecoder implements Decoder {
this.response.body().close(); this.response.body().close();
} }
catch (IOException ex) { catch (IOException ex) {
ex.printStackTrace(); log.error("Error closing response body", ex);
} }
} }
......
...@@ -34,10 +34,12 @@ import com.netflix.zuul.ZuulFilter; ...@@ -34,10 +34,12 @@ import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.constants.ZuulConstants; import com.netflix.zuul.constants.ZuulConstants;
import com.netflix.zuul.constants.ZuulHeaders; import com.netflix.zuul.constants.ZuulHeaders;
import com.netflix.zuul.context.RequestContext; import com.netflix.zuul.context.RequestContext;
import lombok.extern.apachecommons.CommonsLog;
/** /**
* @author Spencer Gibb * @author Spencer Gibb
*/ */
@CommonsLog
public class SendResponseFilter extends ZuulFilter { public class SendResponseFilter extends ZuulFilter {
private static DynamicBooleanProperty INCLUDE_DEBUG_HEADER = DynamicPropertyFactory private static DynamicBooleanProperty INCLUDE_DEBUG_HEADER = DynamicPropertyFactory
...@@ -157,7 +159,7 @@ public class SendResponseFilter extends ZuulFilter { ...@@ -157,7 +159,7 @@ public class SendResponseFilter extends ZuulFilter {
} }
catch (IOException ex) { catch (IOException ex) {
// ignore // ignore
ex.printStackTrace(); log.debug("Error writing response", ex);
} }
// doubles buffer size if previous read filled it // doubles buffer size if previous read filled it
if (bytesRead == bytes.length) { if (bytesRead == bytes.length) {
......
...@@ -84,7 +84,7 @@ public class HystrixStreamTask implements ApplicationContextAware { ...@@ -84,7 +84,7 @@ public class HystrixStreamTask implements ApplicationContextAware {
this.channel.send(json); this.channel.send(json);
} }
catch (Exception ex) { catch (Exception ex) {
ex.printStackTrace(); log.error("Error sending json to channel", ex);
} }
} }
} }
......
...@@ -49,6 +49,7 @@ import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer; ...@@ -49,6 +49,7 @@ import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;
*/ */
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@Configuration @Configuration
@CommonsLog
public class HystrixDashboardConfiguration { public class HystrixDashboardConfiguration {
private static final String DEFAULT_TEMPLATE_LOADER_PATH = "classpath:/templates/"; private static final String DEFAULT_TEMPLATE_LOADER_PATH = "classpath:/templates/";
...@@ -208,7 +209,7 @@ public class HystrixDashboardConfiguration { ...@@ -208,7 +209,7 @@ public class HystrixDashboardConfiguration {
is.close(); is.close();
} }
catch (Exception ex) { catch (Exception ex) {
// e.printStackTrace(); log.debug("Error closing input stream", ex);
} }
} }
} }
......
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