问题描述
我有一个使用Spring和CXF的Java服务。代码来自以前的开发人员,我正在提供维护,但我在日志中看到了这一点
I have a Java service that uses Spring and CXF. The code is from a previous developer and I'm providing maintenance, but I'm seeing this in the logs
--------------------------------------
Apr 16, 2013 1:44:11 PM org.apache.cxf.interceptor.AbstractLoggingInterceptor log
INFO: Inbound Message
----------------------------
ID: 33
Address: /MyApplication/endpoint
Encoding: UTF-8
Http-Method: POST
Content-Type: application/x-www-form-urlencoded
Headers: {content-type=[application/x-www-form-urlencoded], connection=[close], host= [localhost:8080], Content-Length=[11504], user-agent=[Apache-HttpClient/4.2.3 (java 1.5)], Content-Type=[application/x-www-form-urlencoded]}
Payload: {
"events" :
[ { event }, { event }, ... ]
}
我们也有许多事件,日志变得无法管理。有没有办法可以关闭这个日志记录?这些日志调用不是从应用程序内部创建的,它们是由某种我无法找到的拦截器创建的。我确实在cxf-context.xml配置文件中找到了这个:
And we have too many events, and the log is becoming unmanageable. Is there a way I can turn off this logging? These log calls are not created from inside the app, they are created by some kind of interceptor which I can't find. I did find this in the cxf-context.xml config file:
<cxf:bus>
<cxf:features>
<cxf:logging />
</cxf:features>
</cxf:bus>
但是,在我已经从配置文件中注释掉这些行之后,日志记录仍会显示。
But the logging still appears after I already commented these lines out of the config file.
请帮忙。谢谢
推荐答案
由于应用程序使用log4j,请将'org.apache.cxf'记录器级别转为ERROR。将此行添加到log4j.properties:
Since the application uses log4j, turn the 'org.apache.cxf' Logger level to ERROR. Add this line to log4j.properties:
log4j.logger.org.apache.cxf=ERROR
这篇关于如何关闭额外的日志记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!