【发布时间】:2019-08-07 12:05:37
【问题描述】:
我有 2 个服务 - Service 1 和 Service 2。 Service 1 通过 Spring Rest 模板调用一些 Service 2 API。现在Service 2 发生了一些异常。我需要它在Service 1 中的整个堆栈跟踪。如何获得?
Service 1 ---calls--> Service 2
堆栈跟踪是否会被 Spring 传递给 Service 1 ?
你可以说我是这样打电话的:
HttpHeaders headers = new HttpHeaders();
headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
HttpEntity<String> entity = new HttpEntity<String>(headers);
return restTemplate.exchange("http://localhost:8080/products", HttpMethod.GET, entity, String.class).getBody();
【问题讨论】:
-
distributed tracing。根据来自集中式日志记录解决方案的跟踪 id 获取日志
标签: java spring spring-boot spring-mvc resttemplate