Logging Messages
CXF
...
CXF includes two logging interceptors which output the incoming/outgoing messages to the Java log. To enable, you need to add these interceptors to your endpoint.
...
Code Block |
---|
import javax.xml.ws.Endpoint; import org.apache.cxf.core.interceptor.LoggingInInterceptor; import org.apache.cxf.core.interceptor.LoggingOutInterceptor; import org.apache.cxf.jaxws.EndpointImpl; EndpointImpl ep = (EndpointImpl) Endpoint.publish("http://localhost/service", service); ep.getServer().getEndpoint().getInInterceptors().add(new LoggingInInterceptor()); ep.getServer().getEndpoint().getOutInterceptors().add(new LoggingOutInterceptor()); |
...
You can also enable message logging through configuration: CXF configuration.
Configure logging levels.
CXF uses Java SE Logging. In the /etc folder of the CXF distribution there is a sample logging.properties file you can use to configure logging. Once done, you will need to set the -Djava.util.logging.config.file property to the location of the logging.properties file. As an example, the Ant target below has this property set:
...