Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.Este contenido no está disponible en el idioma seleccionado.
16.6. Logging Message Content
Configuring message content logging Copiar enlaceEnlace copiado en el portapapeles!
Adding the logging feature to an endpoint Copiar enlaceEnlace copiado en el portapapeles!
Example 16.11. Adding Logging to Endpoint Configuration
<jaxws:endpoint ...>
<jaxws:features>
<bean class="org.apache.cxf.feature.LoggingFeature"/>
</jaxws:features>
</jaxws:endpoint>
<jaxws:endpoint ...>
<jaxws:features>
<bean class="org.apache.cxf.feature.LoggingFeature"/>
</jaxws:features>
</jaxws:endpoint>
Adding the logging feature to a consumer Copiar enlaceEnlace copiado en el portapapeles!
Example 16.12. Adding Logging to Client Configuration
<jaxws:client ...>
<jaxws:features>
<bean class="org.apache.cxf.feature.LoggingFeature"/>
</jaxws:features>
</jaxws:client>
<jaxws:client ...>
<jaxws:features>
<bean class="org.apache.cxf.feature.LoggingFeature"/>
</jaxws:features>
</jaxws:client>
Set logging to log INFO level messages Copiar enlaceEnlace copiado en el portapapeles!
logging.properties file associated with your service is configured to log INFO level messages, as shown in Example 16.13, “Setting the Logging Level to INFO”.
Example 16.13. Setting the Logging Level to INFO
.level= INFO java.util.logging.ConsoleHandler.level = INFO
.level= INFO
java.util.logging.ConsoleHandler.level = INFO
Logging SOAP messages Copiar enlaceEnlace copiado en el portapapeles!
InstallDir/samples/wsdl_first directory, as follows:
- Add the
jaxws:featureselement shown in Example 16.14, “Endpoint Configuration for Logging SOAP Messages” to thecxf.xmlconfiguration file located in the wsdl_first sample's directory:Example 16.14. Endpoint Configuration for Logging SOAP Messages
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - The sample uses the default
logging.propertiesfile, which is located in theInstallDir/etcdirectory. Make a copy of this file and name itmylogging.properties. - In the
mylogging.propertiesfile, change the logging levels toINFOby editing the.leveland thejava.util.logging.ConsoleHandler.levelconfiguration properties as follows:.level= INFO java.util.logging.ConsoleHandler.level = INFO
.level= INFO java.util.logging.ConsoleHandler.level = INFOCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Start the server using the new configuration settings in both the
cxf.xmlfile and themylogging.propertiesfile as follows:Expand Platform Command Windows start java -Djava.util.logging.config.file=%CXF_HOME%\etc\mylogging.properties demo.hw.server.ServerUNIX java -Djava.util.logging.config.file=$CXF_HOME/etc/mylogging.properties demo.hw.server.Server & - Start the hello world client using the following command:
Expand Platform Command Windows java -Djava.util.logging.config.file=%CXF_HOME%\etc\mylogging.properties demo.hw.client.Client .\wsdl\hello_world.wsdlUNIX java -Djava.util.logging.config.file=$CXF_HOME/etc/mylogging.properties demo.hw.client.Client ./wsdl/hello_world.wsdl