com.ibm.commerce.ras

Class MessageLogEvent

  • java.lang.Object
    • com.ibm.commerce.ras.MessageLogEvent


  • public class MessageLogEvent
    extends java.lang.Object
    MessageLogEvent class is used to format the message text for message log in service. Each message contains two parts: header and body.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
    • Constructor Summary

      Constructors 
      Constructor and Description
      MessageLogEvent(java.sql.Timestamp time, java.lang.String threadName, IOutputManager outputMgr, ECMessage msg, java.lang.String clsName, java.lang.String mtdName, java.lang.Object[] params)
      Constructor for MessageLogEvent.
      MessageLogEvent(java.sql.Timestamp time, java.lang.String threadName, java.lang.String uniqueClientId, IOutputManager outputMgr, ECMessage msg, java.lang.String clsName, java.lang.String mtdName, java.lang.Object[] params)
      Constructor for MessageLogEvent.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String createMessageBody()
      Creates the message body.
      java.lang.String getCompactMessageBody()
      Gets the message body in compact format.
      java.lang.Throwable getException()
      Gets the exception of the message.
      java.lang.String getMessageBody()
      Builds the message body.
      void print()
      Print out the message text in specified output manager
      void setException(java.lang.Throwable newException)
      Sets the exception.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MessageLogEvent

        public MessageLogEvent(java.sql.Timestamp time,
                               java.lang.String threadName,
                               IOutputManager outputMgr,
                               ECMessage msg,
                               java.lang.String clsName,
                               java.lang.String mtdName,
                               java.lang.Object[] params)
        Constructor for MessageLogEvent.
        Parameters:
        time - the timestamp of the log entry
        threadName - the thread that message is generated by
        outputMgr - output device to write the logs
        msg - the message object
        clsName - class name that generates the message
        mtdName - method name that generates the message
        params - the list of parameters that will be substituted into the message text
      • MessageLogEvent

        public MessageLogEvent(java.sql.Timestamp time,
                               java.lang.String threadName,
                               java.lang.String uniqueClientId,
                               IOutputManager outputMgr,
                               ECMessage msg,
                               java.lang.String clsName,
                               java.lang.String mtdName,
                               java.lang.Object[] params)
        Constructor for MessageLogEvent.
        Parameters:
        time - the timestamp of the log entry
        threadName - the thread that message is generated by
        uniqueClientId - the unique Id to represent the client; used to debug double click problem
        outputMgr - output device to write the logs
        msg - the message object
        clsName - class name that generates the message
        mtdName - method name that generates the message
        params - the list of parameters that will be substituted into the message text
    • Method Detail

      • createMessageBody

        public java.lang.String createMessageBody()
        Creates the message body. The message body can be in either detailed or compact format.
        Returns:
        formatted message body
      • getCompactMessageBody

        public java.lang.String getCompactMessageBody()
        Gets the message body in compact format.
        Returns:
        the message text in compact format
      • getException

        public java.lang.Throwable getException()
        Gets the exception of the message.
        Returns:
        exception associated to the message
      • getMessageBody

        public java.lang.String getMessageBody()
        Builds the message body. The message body includes the class, method name, severity, the translated message and exception if any.
        Returns:
        the message text in detailed format
      • setException

        public void setException(java.lang.Throwable newException)
        Sets the exception.
        Parameters:
        newException - exception object associated to the message
      • print

        public void print()
        Print out the message text in specified output manager