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

编程入门 行业动态 更新时间:2024-10-25 13:20:56
本文介绍了如何关闭额外的日志记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个使用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.apache.cxf=ERROR

更多推荐

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

本文发布于:2023-11-25 04:14:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1628277.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:日志

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!