How can I turn off extra logging?

这一生的挚爱 提交于 2019-11-27 07:02:08

问题


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 }, ... ]
 }

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.

Please help. Thanks


回答1:


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


来源:https://stackoverflow.com/questions/16072515/how-can-i-turn-off-extra-logging

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!