简体   繁体   English

如何关闭额外的日志记录?

[英]How can I turn off extra logging?

I have a Java service that uses Spring and CXF. 我有一个使用Spring和CXF的Java服务。 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-context.xml配置文件中找到了它:

<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 谢谢

Since the application uses log4j, turn the 'org.apache.cxf' Logger level to ERROR. 由于该应用程序使用log4j,因此将“ org.apache.cxf”记录器级别设置为ERROR。 Add this line to log4j.properties: 将此行添加到log4j.properties:

log4j.logger.org.apache.cxf=ERROR

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM