How do I log response in Spring RestTemplate?

后端 未结 5 1366
滥情空心
滥情空心 2020-12-09 18:12

I am using RestTemplate to make calls to a web service.

String userId = restTemplate.getForObject(createUserUrl, String.class);

If this fai

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-09 19:00

    Depending on which method of making the HTTP connection you are using, you could look at turning up the logging within the actual HTTP connection classes.

    For example, if you are using commons HttpClient, you can set

    log4j.logger.httpclient.wire=DEBUG
    

    The commons-httpclient project has an entire page in the documentation on their logging practices.

提交回复
热议问题