Logging of messages sent with Spring WS client
02-Aug-2012
When sending messages with Spring WS client, observing of actual sent and received messages is often required. To set the logging level, add the following lines in log4j.properties:
log4j.logger.org.springframework.ws.client.MessageTracing.sent=TRACE
log4j.logger.org.springframework.ws.client.MessageTracing.received=TRACE
Here’s what you might observe in the logs:
2012-08-02 12:31:49,615 TRACE [org.springframework.ws.client.MessageTracing.sent] - Sent request [<SOAP-ENV:Envelope...
2012-08-02 12:31:50,581 TRACE [org.springframework.ws.client.MessageTracing.received] - Received response [<env:Envelope
For more info about message logging see this chapter of the excellent Spring WS documentation.