How to configure RestTemplate debug logging in log4j2 xml
问题 I am using log4j2 with xml configuration. I want to log all the JSON created by restTemplate How can I configure it in log4j2 xml configuration file to log these? 回答1: If your RestTemplate uses apache http client, your log4j2.xml configuration could look like this: <Logger name="org.springframework.web.client" level="DEBUG" additivity="false"> <AppenderRef ref="APP" level="DEBUG"/> </Logger> <Logger name="org.apache.http.wire" level="DEBUG" additivity="false"> <AppenderRef ref="APP" level=