I am using RestTemplate to make calls to a web service.
String userId = restTemplate.getForObject(createUserUrl, String.class);
If this fai
You can use spring-rest-template-logger to log RestTemplate HTTP traffic.
Add a dependency to your Maven project:
org.hobsoft.spring
spring-rest-template-logger
2.0.0
Then customize your RestTemplate as follows:
RestTemplate restTemplate = new RestTemplateBuilder()
.customizers(new LoggingCustomizer())
.build()
Ensure that debug logging is enabled in application.properties:
logging.level.org.hobsoft.spring.resttemplatelogger.LoggingCustomizer = DEBUG
Now all RestTemplate HTTP traffic will be logged to org.hobsoft.spring.resttemplatelogger.LoggingCustomizer at debug level.
DISCLAIMER: I wrote this library.