org.aitools.programd.logging
Class XMLChatLogLayout

java.lang.Object
  extended by org.apache.log4j.Layout
      extended by org.aitools.programd.logging.XMLChatLogLayout
All Implemented Interfaces:
org.apache.log4j.spi.OptionHandler

public class XMLChatLogLayout
extends org.apache.log4j.Layout

Formats a ChatLogEvent by printing a number of extra fields as we like them.

Since:
4.6
Author:
Noel Bush

Field Summary
private static java.lang.String BOTID_END
           
private static java.lang.String BOTID_START
           
private static java.lang.String EVENT_END
           
private static java.lang.String EVENT_START
           
private static java.lang.String INPUT_END
           
private static java.lang.String INPUT_START
           
private static java.lang.String REPLY_END
           
private static java.lang.String REPLY_START
           
private static java.lang.String TIME_END
           
private static java.lang.String TIME_START
           
private  org.apache.log4j.helpers.ISO8601DateFormat timestampFormatter
           
private static java.lang.String USERID_END
           
private static java.lang.String USERID_START
           
 
Fields inherited from class org.apache.log4j.Layout
LINE_SEP, LINE_SEP_LEN
 
Constructor Summary
XMLChatLogLayout()
           
 
Method Summary
 void activateOptions()
           
 java.lang.String format(ChatLogEvent event)
           
 java.lang.String format(org.apache.log4j.spi.LoggingEvent event)
          We insist that the record be a ChatLogEvent.
 java.lang.String getFooter()
           
 java.lang.String getHeader()
           
 boolean ignoresThrowable()
           
 
Methods inherited from class org.apache.log4j.Layout
getContentType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timestampFormatter

private org.apache.log4j.helpers.ISO8601DateFormat timestampFormatter

EVENT_START

private static final java.lang.String EVENT_START
See Also:
Constant Field Values

EVENT_END

private static final java.lang.String EVENT_END
See Also:
Constant Field Values

TIME_START

private static final java.lang.String TIME_START
See Also:
Constant Field Values

TIME_END

private static final java.lang.String TIME_END
See Also:
Constant Field Values

BOTID_START

private static final java.lang.String BOTID_START
See Also:
Constant Field Values

BOTID_END

private static final java.lang.String BOTID_END
See Also:
Constant Field Values

USERID_START

private static final java.lang.String USERID_START
See Also:
Constant Field Values

USERID_END

private static final java.lang.String USERID_END
See Also:
Constant Field Values

INPUT_START

private static final java.lang.String INPUT_START
See Also:
Constant Field Values

INPUT_END

private static final java.lang.String INPUT_END
See Also:
Constant Field Values

REPLY_START

private static final java.lang.String REPLY_START
See Also:
Constant Field Values

REPLY_END

private static final java.lang.String REPLY_END
See Also:
Constant Field Values
Constructor Detail

XMLChatLogLayout

public XMLChatLogLayout()
Method Detail

format

public java.lang.String format(org.apache.log4j.spi.LoggingEvent event)
We insist that the record be a ChatLogEvent.

Specified by:
format in class org.apache.log4j.Layout
Parameters:
event - the ChatLogEvent to format
Returns:
the result of formatting the given ChatLogEvent
Throws:
java.lang.IllegalArgumentException - if the record is not a ChatLogEvent

format

public java.lang.String format(ChatLogEvent event)
Parameters:
event - the ChatLogEvent to format
Returns:
the result of formatting the given ChatLogEvent

getHeader

public java.lang.String getHeader()
Overrides:
getHeader in class org.apache.log4j.Layout

getFooter

public java.lang.String getFooter()
Overrides:
getFooter in class org.apache.log4j.Layout

ignoresThrowable

public boolean ignoresThrowable()
Specified by:
ignoresThrowable in class org.apache.log4j.Layout
See Also:
Layout.ignoresThrowable()

activateOptions

public void activateOptions()
See Also:
OptionHandler.activateOptions()