Skip to content

Commit

Permalink
feature: Rest请求结果的日志信息中,增加 requestUrl 地址,方便日志过滤
Browse files Browse the repository at this point in the history
  • Loading branch information
myoss committed Apr 26, 2019
1 parent 0e3396b commit 7846b18
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static <T> T exchange(RestTemplate restTemplate, HttpHeaders httpHeaders,
ResponseEntity<T> responseEntity = restTemplate.exchange(uri, method, httpEntity, responseType);
T responseBody = responseEntity.getBody();
long costTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start);
log.info("costTime: {}, responseBody: {}", costTime, responseBody);
log.info("requestUrl: {}, costTime: {}, responseBody: {}", uri, costTime, responseBody);
if (restRequestCallback != null) {
// 执行后置操作
responseBody = restRequestCallback.afterRequest(restTemplate, uri, method, httpEntity, responseType,
Expand Down

0 comments on commit 7846b18

Please sign in to comment.