How can I make Spring WebServices log all SOAP requests?

前端 未结 7 1987
遇见更好的自我
遇见更好的自我 2020-12-04 16:43

I need all SOAP requests logged in the CommonLogFormat (see http://en.wikipedia.org/wiki/Common_Log_Format), plus the duration (the amount of time it takes to p

7条回答
  •  一生所求
    2020-12-04 16:57

    First, SLF4J is just a simple facade. It means you still need a logging framework(e.g. java.util.logging, logback, log4j).

    Second, Spring-ws uses Commons Logging interface that is another simple facade like SLF4J.

    Finally, you can use below setting to enable Spring-ws message logging functionality.

    log4j.logger.org.springframework.ws.client.MessageTracing.sent=DEBUG
    log4j.logger.org.springframework.ws.client.MessageTracing.received=TRACE
    
    log4j.logger.org.springframework.ws.server.MessageTracing.sent=DEBUG
    log4j.logger.org.springframework.ws.server.MessageTracing.received=TRACE
    

提交回复
热议问题