2 Replies Latest reply on Mar 17, 2006 5:12 AM by Anders Hedstrom

    Loggin all incoming soap messages

    Kristof Taveirne Newbie

      Hi,
      Is there a way to log ALL incoming soap messages using Log4J on JBoss?
      Anybody done this before?

      I would like to just see the XML appear in a log file everytime somebody submits a request to the web service. This is for debugging reasons only.

      Or am I forced to use ethereal for this kind of "spying"?

      Thanks alot

      Kristof.

        • 1. Re: Loggin all incoming soap messages
          Heiko Braun Novice

          I think you got three options:

          1.) use some TCP monitor
          2.) provide a jaxrpc handler
          3.) set the log level to DEBUG for org.jboss.ws.soap

          The first option is always handy, the second one probably the most appropriate whereas the last option is the easiest.

          • 2. Re: Loggin all incoming soap messages
            Anders Hedstrom Novice

            If your using the jboss-ws4ee soap stack you would set the log level to debug for org.jboss.axis

            What I do is that I create a new appender and a new category in log4j.xml. The following example will log all incomming soap requests and the following response sent back the caller.

            <appender name="SOAP-FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
             <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
             <param name="File" value="${jboss.server.home.dir}/log/soap.log"/>
             <param name="Append" value="false"/>
             <param name="DatePattern" value="'.'yyyy-MM-dd"/>
             <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern" value="%d %-5p [%t] %m%n"/>
             </layout>
            </appender>
            
            ...
            
            <category name="org.jboss.axis.transport.http.AxisServlet" additivity="false">
             <priority value="DEBUG"/>
             <appender-ref ref="SOAP-FILE"/>
            </category>