CXF Configuration

From bemoko developer wiki

Jump to: navigation, search

Taking Control of the CXF Logging

By default CXF logs quite a few messages to the INFO level, e.g.

Apr 2, 2009 9:37:59 AM org.apache.cxf.bus.spring.BusApplicationContext getConfigResources
INFO: No cxf.xml configuration file detected, relying on defaults.
Apr 2, 2009 9:44:08 AM org.apache.cxf.endpoint.dynamic.DynamicClientFactory outputDebug
INFO: Created classes: ...

You can configure the logging in one of a few ways:

  1. Change the logging level of the JDK java.utils.logging by configuring $JAVA_HOME/lib/logging.properties
  2. Overriding the java.utils.logging configuration file with the JVM system parameter -Djava.util.logging.config.file[1]
  3. Configuring CXF to use a Log4JLogger with the JVM system parameter -Dorg.apache.cxf.Logger=org.apache.cxf.common.logging.Log4jLogger
  4. Adding a file called META-INF/cxf/org.apache.cxf.Logger to the classpath with the content org.apache.cxf.common.logging.Log4jLogger[2]
  5. Programmatically setting the logging class in your plugin org.apache.cxf.common.logging.LogUtils.setLoggerClass(Class.forName("org.apache.cxf.common.logging.Log4jLogger", true, this.class.getClassLoader()))