我需要在 CommonLogFormat
(参见 http://en.wikipedia.org/wiki/Common_Log_Format )中记录的所有 SOAP 请求,以及持续时间(处理请求所需的时间)。
最好的方法是什么?看起来可以为 Spring WebServices 配置 log4j,但它会记录我感兴趣的所有值吗? http://pijava.wordpress.com/2009/12/04/spring-webservice-soap-requestresponse-logging-with-log4j/
编辑:我们实际上使用的是 SLF4J
,而不是 Log4j
。此外,看起来可以通过配置 PayloadLoggingInterceptor 来做到这一点: http ://static.springsource.org/spring-ws/site/reference/html/server.html#server-endpoint-interceptor
但我不确定日志消息会去哪里。我将该拦截器添加到我们的拦截器中,但没有看到任何日志消息。
原文由 Nate Reed 发布,翻译遵循 CC BY-SA 4.0 许可协议
对于在下面添加的 Spring Boot 项目
application.properties
对我有用: