4 Replies Latest reply on Dec 1, 2006 9:03 AM by Justin Bertram

    Log4j and Web Service question

    Alisa Thomson Newbie

      Currently, I only receive the SOAP messages when I have DEBUG mode enabled. I want to be able to log the SOAP calls in INFO mode..how do I set up an appender to do this?

        • 1. Re: Log4j and Web Service question
          Steve Newbie

          actually you wont be able to move the soap messages to the info level as such.

          You will need to set the level on your appender to debug and use categories to filter out what you dont want.

          http://docs.jboss.org/process-guide/en/html/logging.html

          Also do you really want your soap messages going to the info level, some of them can be fairly substanital (depending on your code).

          • 2. Re: Log4j and Web Service question
            Alisa Thomson Newbie

            Yes, I want to log the SOAP request/response for support reasons. If we can see the actual request being sent by a user, we can support any problems more quickly. I was hoping not to have to use DEBUG since it throws in alot more trash than I wanted to filter out. Thanks for the reply.

            • 3. Re: Log4j and Web Service question
              Heiko Braun Master

              There's a virtual category jbossws.SOAPMessage that we use for logging. Set it to TRACE in order to log request/response messages. You can aswell define an own appender for it.

              • 4. Re: Log4j and Web Service question
                Justin Bertram Newbie

                Here's an example...

                The appender I'm using:

                 <appender name="SOAP" 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="true"/>
                 <param name="Threshold" value="DEBUG"/>
                 <param name="DatePattern" value="yyyy-MM-dd"/>
                
                 <layout class="org.apache.log4j.PatternLayout">
                 <param name="ConversionPattern" value="[%x] %d{ABSOLUTE} [%c{1}] %m%n"/>
                 </layout>
                 </appender>
                


                The category I am using:
                 <!-- set the "priority" to DEBUG to see SOAPMessage output in file "soap.log" -->
                 <category name="jbossws.SOAPMessage">
                 <priority value="DEBUG"/>
                 <appender-ref ref="SOAP"/>
                 </category>