Announcement Announcement Module
Collapse
No announcement yet.
Payload logging Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Payload logging

    I am having some issues with Payload logging. I am able to log the messages successfully in my local environment . The messages are not logged in my test environment .. any reason what could be the issue?

    Overloaded the payloadlogging interceptor like



    import javax.xml.transform.Source;

    import org.springframework.ws.WebServiceMessage;
    import org.springframework.ws.server.endpoint.AbstractLog gingInterceptor;

    import com.railinc.library.log.Log;
    import com.railinc.library.log.Logger;

    public class PayloadLoggingInterceptor extends AbstractLoggingInterceptor
    {

    private Logger rLogger = Log.get(PayloadLoggingInterceptor.class.getName()) ;

    protected Source getSource(WebServiceMessage message)
    {
    return message.getPayloadSource();
    }

    @Override
    protected void logMessage(String message)
    {
    rLogger.debug(message, null);
    }
    }

  • #2
    How does your local environment differ from your test environment?

    Does it work if you use org.springframework.ws.server.endpoint.interceptor .PayloadLoggingInterceptor?

    Comment


    • #3
      Thanks for your reply.

      There is no difference between the local and other environments.

      No it doesnt work if we use the PayloadLogginginterceptor. That is the reason we overloaded and tried this approach

      Any help is highly appreciated

      Comment


      • #4
        Are you sure your logging is configured to show debug messages from the logger used by the interceptor? In case you've changed the interceptor's loggerName property, have you changed the logging config accordingly?

        Are you sure the interceptor's logRequest property is set to true (default)?

        Are you sure the interceptor actually gets invoked? Set a breakpoint and debug to make sure. While you're at it, continue debugging the logger.debug() call to find out whether the actual control flow is what you expect.

        If the interceptor does get invoked, try System.out.println("***") and see if your message gets written to stdout.

        And so on..

        Comment


        • #5
          application context
          ------------------

          <bean name="loggingInterceptor" class="com.railinc.emisquery.ws.mapping.PayloadLog gingInterceptor">
          <property name="logRequest" value="true"/>
          <property name="logResponse" value="true"/>
          </bean>


          PayloadLogginginterceptor
          ------------------------


          mport javax.xml.transform.Source;

          import org.springframework.ws.WebServiceMessage;
          import org.springframework.ws.server.endpoint.AbstractLog gingInterceptor;

          import com.library.log.Log;
          import com.library.log.Logger;

          public class PayloadLoggingInterceptor extends AbstractLoggingInterceptor
          {

          private Logger rLogger = Log.get(PayloadLoggingInterceptor.class.getName()) ;

          protected Source getSource(WebServiceMessage message)
          {
          System.out.println("Inside Payload Logging interceptor"+message.getPayloadSource());
          return message.getPayloadSource();
          }

          /**
          * Logs the given string message. <p/> By default, this method uses a
          * "debug" level of logging. Subclasses can override this method to change
          * the level of loging used by the logger.
          *
          * @param message
          * the message
          */


          protected void logMessage(String message)
          {
          System.out.println("Inside Payload Logging interceptor message String"+message);
          rLogger.debug(message, null);
          }
          }

          log4j
          -----

          log4j.category.org.springframework.ws=ALL, temp-services, temp-services-debug
          log4j.category.com.railinc.emisquery.ws=ALL, temp-services, temp-services-debug
          log4j.category.org.springframework.xml=ALL, temp-services, temp-services-debug
          log4j.category.org.springframework.ws.server.endpo int.interceptor=ALL, temp-services-message
          log4j.category.org.springframework.ws.soap.server. endpoint.interceptor=ALL, temp-services-message
          log4j.category.org.springframework.ws.server.endpo int.interceptor.PayloadTransformingInterceptor =ALL, temp-services-message
          log4j.logger.org.springframework.ws.server.Message Tracing=ALL, temp-services-message

          log4j.additivity.com.railinc.emisquery.ws=false
          log4j.additivity.org.springframework.xml= false
          log4j.additivity.org.springframework.ws=false
          log4j.additivity.org.springframework.ws.server.end point.interceptor=false

          DO you see any issues.. it is logging in windows machine but not in unix machines

          Comment

          Working...
          X