Making CXF Log RuntimeExceptions From Server Implementations

Here is a bit more on CXF logging.

If you are using CXF to host web-service implementations (as opposed to using CXF as a client to consume web services with), you might wanna know about any un-caught RuntimeExceptions, your server-side implementation is throwing. CXF already catches and logs this for you, before sending them back as faults. So, basically, this post boils down to showing you which logger names to enable which level on.

  • Logger name: org.apache.cxf.phase.PhaseInterceptorChain
  • At least level required: INFO

As mentioned in my post on how to configure log4j as logging engine in cxf, cxf comes out of the box with JavaSE logging (java.util.logging) as its logging engine. If you haven’t reconfigured this, nor the Java SE standard logging configuration, you are in luck, as the default level then will be INFO already.
If you have reconfigured cxf to use log4j as its logging engine, chances are you need something like this is you log4j.xml configuration:


<logger name="org.apache.cxf.phase.PhaseInterceptorChain">
   <level value="info"/>
</logger>

You might also want to enable logging of inbound and outbound messages in cxf, which is done by enabling INFO on these loggers:

  • org.apache.cxf.interceptor.LoggingInInterceptor
  • org.apache.cxf.interceptor.LoggingOutInterceptor

February 28, 2008 В· polesen В· No Comments
Tags: , ,  В· Posted in: Programming

Leave a Reply