atg.nucleus.logging
Class LogEvent

java.lang.Object
  extended by atg.nucleus.logging.LogEvent
Direct Known Subclasses:
DebugLogEvent, ErrorLogEvent, InfoLogEvent, SampleLogEvent, WarningLogEvent

public class LogEvent
extends java.lang.Object

A basic log event.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
LogEvent(java.lang.String pMessage)
          Constructs a LogEvent with the given message.
LogEvent(java.lang.String pMessage, java.lang.String pOriginator)
          Constructs a LogEvent with the given message and originator
LogEvent(java.lang.String pMessage, java.lang.String pOriginator, java.lang.Throwable pThrowable)
          Constructs a LogEvent with the given message, originator and throwable
LogEvent(java.lang.String pMessage, java.lang.Throwable pThrowable)
          Constructs a LogEvent with the given message and throwable
 
Method Summary
 java.util.Date getDateTimeStamp()
          Returns property DateTimeStamp
 java.lang.String getIdentifier()
          Returns property Identifier
 java.lang.String getMessage()
          Returns property Message
 java.lang.String getNullObjectReplacement()
          Returns property NullObjectReplacement
 java.lang.String getOriginator()
          Returns property Originator
 java.lang.Throwable getThrowable()
          Returns property Throwable
 long getTimeStamp()
          Returns property TimeStamp
 java.lang.String getTokenSeperator()
          Returns property TokenSeperator
 void setNullObjectReplacement(java.lang.String pNullObjectReplacement)
          Sets property NullObjectReplacement
 void setTokenSeperator(java.lang.String pTokenSeperator)
          Sets property TokenSeperator
 java.lang.String toString()
          Returns the log event as a String in the following format:
 java.lang.StringBuffer toStringBuffer()
          Returns the log event as a StringBuffer in the following format:
 void writeLogLinePrefix(java.io.PrintStream pOut)
          Writes the prefix that will be used at the beginning of each line in the log message.
 void writeLogMessage(java.io.PrintStream pOut)
          Writes the log message to the specified print stream.
 void writeOriginatorPrefix(java.io.PrintStream pOut)
          Writes the log message to the specified print stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

LogEvent

public LogEvent(java.lang.String pMessage)
Constructs a LogEvent with the given message.


LogEvent

public LogEvent(java.lang.String pMessage,
                java.lang.String pOriginator)
Constructs a LogEvent with the given message and originator


LogEvent

public LogEvent(java.lang.String pMessage,
                java.lang.Throwable pThrowable)
Constructs a LogEvent with the given message and throwable


LogEvent

public LogEvent(java.lang.String pMessage,
                java.lang.String pOriginator,
                java.lang.Throwable pThrowable)
Constructs a LogEvent with the given message, originator and throwable

Method Detail

setTokenSeperator

public void setTokenSeperator(java.lang.String pTokenSeperator)
Sets property TokenSeperator


getTokenSeperator

public java.lang.String getTokenSeperator()
Returns property TokenSeperator


setNullObjectReplacement

public void setNullObjectReplacement(java.lang.String pNullObjectReplacement)
Sets property NullObjectReplacement


getNullObjectReplacement

public java.lang.String getNullObjectReplacement()
Returns property NullObjectReplacement


getIdentifier

public java.lang.String getIdentifier()
Returns property Identifier


getTimeStamp

public long getTimeStamp()
Returns property TimeStamp


getDateTimeStamp

public java.util.Date getDateTimeStamp()
Returns property DateTimeStamp


getOriginator

public java.lang.String getOriginator()
Returns property Originator


getMessage

public java.lang.String getMessage()
Returns property Message


getThrowable

public java.lang.Throwable getThrowable()
Returns property Throwable


writeLogLinePrefix

public void writeLogLinePrefix(java.io.PrintStream pOut)
Writes the prefix that will be used at the beginning of each line in the log message. The prefix consists of the identifier (type), date, time, and originator.


writeOriginatorPrefix

public void writeOriginatorPrefix(java.io.PrintStream pOut)
Writes the log message to the specified print stream. Only the originator will be written.


writeLogMessage

public void writeLogMessage(java.io.PrintStream pOut)
Writes the log message to the specified print stream. Only the message, exception, and exception stack trace will be written.


toStringBuffer

public java.lang.StringBuffer toStringBuffer()
Returns the log event as a StringBuffer in the following format:

id date millis originator message throwable

(tab delimited instead of space delimited). If the originator or message are not set, the NullObjectReplacement property will be used.


toString

public java.lang.String toString()
Returns the log event as a String in the following format:

id date millis originator message throwable

(tab delimited instead of space delimited). If the originator or message are not set, the NullObjectReplacement property will be used.

Overrides:
toString in class java.lang.Object