5

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

avillagomez
  • 443
  • 1
  • 8
  • 18
  • 1
    Do the application use some log API? Have you tried to put 'org.apache.cxf' Logger to ERROR level? – DiogoSantana Apr 18 '13 at 00:37
  • @DiogoSantana The application already uses log4j, but I need to eliminate this extra logging altogether. How can I change the 'org.apache.cxf' Logger to ERROR level? – avillagomez Apr 18 '13 at 00:39
  • If I'm not wrong you add a line to log4j.properties like this: log4j.logger.com.foo=WARN.But it depends on how your app is configuring log4j, or via properties file or via code. – DiogoSantana Apr 18 '13 at 00:47
  • It seems commenting out those lines did the trick, there was some issue with the deployment process not under my control. But thanks – avillagomez Apr 18 '13 at 01:30

1 Answers1

15

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
DiogoSantana
  • 2,404
  • 2
  • 19
  • 24