Child pages
  • Remote Logging

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Instructions for setting up remote logging in CXF using mDNS/Chainsaw

This will let you connect to a CXF container running on your local subnet and view incoming and outgoing messages to services

Set up Logging in the service

  • Ensure that your classpath service includes: (both available from here:
    • jmdns.jar
    • log4j-zeroconf.jar
    • log4j-1.2.14.jar
  • In your web service classpath (e.g. webroot/WEB-INF/classes) create a file META-INF/cxf/org.apache.cxf.Logger and put the following into it:
    Code Block
  • If you don't already have a file in your service classpath create one.
  • Add an mDNS logger to your as follows:
    Code Block
    # Stdout
  • The port log4j.appender.zeroconf.port MUST be unique on the local machine - that is the port the log aggregator will listen on. It can be set to anything you like.
  • In your service beans xml file add a logging interceptor:
    Code Block
    <beans xmlns=""
    	xmlns:xsi="" xmlns:jaxws=""
    	<import resource="classpath:META-INF/cxf/cxf.xml" />
    	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
    	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
    	<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
    	<bean id="logInbound" class="org.apache.cxf.interceptor.LoggingInInterceptor" />
    	<bean id="logOutbound" class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
    			<ref bean="logInbound" />
    			<ref bean="logOutbound" />
    			<ref bean="logOutbound" />
    			<ref bean="logInbound" />
    	<jaxws:endpoint id="CalculateAppropateChannelService"
    				<constructor-arg ref="serviceFactory" />
  • deploy and start the service

Set up the logging monitor

  • download Chainsaw 2.0
  • Open chainsaw (I had a problem with the HTML display and the tooltip window being weird) - this must be running on the same subnet as the service
  • Click on the ZeroConf tab, you should see the logging service defined above.
  • Double click on the zeroconf entry and connect
  • Nothing will be displayed until you have some log messages
  • When the service has been invoked you can drill-down on the specific interceptor logs by selecting the org/apache/cxf/interceptor branch, right clicking and selecting "Focus on org.apache.cxf.interceptor"
  • You should then see live incoming and outgoing messages


I don't think the MDNS logger likes to be reloaded so you might have to restart tomcat rather than reload the service