LibraryLink ToToggle FramesPrintFeedback

Logging Message Content

You can log the content of the messages that are sent between a service and a consumer. For example, you might want to log the contents of SOAP messages that are being sent between a service and a consumer.

To log the messages that are sent between a service and a consumer, and vice versa, complete the following steps:

Add the logging feature your endpoint's configuration as shown in Example 7.11.


The example XML shown in Example 7.11 enables the logging of SOAP messages.

Add the logging feature your client's configuration as shown in Example 7.12.


The example XML shown in Example 7.12 enables the logging of SOAP messages.

Ensure that the logging.properties file associated with your service is configured to log INFO level messages, as shown in Example 7.13.


To see the logging of SOAP messages modify the wsdl_first sample application located in the InstallDir/samples/wsdl_first directory, as follows:

  1. Add the jaxws:features element shown in Example 7.14 to the cxf.xml configuration file located in the wsdl_first sample's directory:


  2. The sample uses the default logging.properties file, which is located in the InstallDir/etc directory. Make a copy of this file and name it mylogging.properties.

  3. In the mylogging.properties file, change the logging levels to INFO by editing the .level and the java.util.logging.ConsoleHandler.level configuration properties as follows:

  4. Start the server using the new configuration settings in both the cxf.xml file and the mylogging.properties file as follows:

    PlatformCommand
    Windowsstart java -Djava.util.logging.config.file=%CXF_HOME%\etc\mylogging.properties demo.hw.server.Server
    UNIXjava -Djava.util.logging.config.file=$CXF_HOME/etc/mylogging.properties demo.hw.server.Server &
  5. Start the hello world client using the following command:

    PlatformCommand
    Windowsjava -Djava.util.logging.config.file=%CXF_HOME%\etc\mylogging.properties demo.hw.client.Client .\wsdl\hello_world.wsdl
    UNIXjava -Djava.util.logging.config.file=$CXF_HOME/etc/mylogging.properties demo.hw.client.Client ./wsdl/hello_world.wsdl

The SOAP messages are logged to the console.