|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.service.datacollection.FormattingLogger
public abstract class FormattingLogger
Base class for data collection loggers that emit plain text output. A FormattingLogger logs data items to a file with a user specfied format. Subclasses should override isValidFormatVariable() and appendField() to specify custom formatting for specialized data items. FormattingSummaryLogger is an example of this. Additionally, concrete subclasses need to initialize and cleanup the output writer. FormattingFileLogger is an example of this.
FormatField
,
FormattingSummaryLogger
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
FormattingLogger()
|
Method Summary | |
---|---|
void |
addDataItem(java.lang.Object pDataItem)
Handle data items for which we listen |
void |
appendField(FormatField pFormatField,
java.lang.Object pDataItem,
java.lang.StringBuffer pBuffer)
Append the specified field of the specified object to the string buffer, applying appropriate formatting. |
void |
doStartService()
This is called after the service has been created, added to the Registry, and configured. |
void |
doStopService()
Flush our data buffers before we are stopped |
void |
flush()
Flush out any data we may have. |
int |
getCount()
Returns property Count |
java.lang.String |
getFieldDelimiter()
Returns property FieldDelimiter |
FormatField[] |
getFormatFields()
Returns property FormatFields |
java.lang.String |
getLineTerminator()
Returns property LineTerminator |
boolean |
isSkipNullObject()
Returns property SkipNullObject |
boolean |
isValidFormatField(FormatField pField)
Is the specified format field valid for this logger? |
boolean |
isValidFormatVariable(java.lang.String pName)
Determine if the specified name is the name of a valid format variable. |
void |
logEvent(LogEvent pLogEvent)
Log an event. |
void |
sanitizeFormatFields()
Filter out and log (if appropriate) any invalid format fields we have. |
void |
setFieldDelimiter(java.lang.String pFieldDelimiter)
Sets property FieldDelimiter |
void |
setFormatFields(FormatField[] pFormatFields)
Sets property FormatFields |
void |
setLineTerminator(java.lang.String pLineTerminator)
Sets property LineTerminator |
void |
setSkipNullObject(boolean pSkipNullObject)
Sets property SkipNullObject |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public FormattingLogger()
Method Detail |
---|
public int getCount()
public void setFormatFields(FormatField[] pFormatFields)
public FormatField[] getFormatFields()
public void setFieldDelimiter(java.lang.String pFieldDelimiter)
public java.lang.String getFieldDelimiter()
public void setLineTerminator(java.lang.String pLineTerminator)
public java.lang.String getLineTerminator()
public void setSkipNullObject(boolean pSkipNullObject)
public boolean isSkipNullObject()
public void sanitizeFormatFields()
public boolean isValidFormatField(FormatField pField)
pField
- the format field to test
public boolean isValidFormatVariable(java.lang.String pName)
pName
- name to check
public void logEvent(LogEvent pLogEvent)
logEvent
in interface LogListener
pLogEvent
- the log eventpublic void addDataItem(java.lang.Object pDataItem)
addDataItem
in interface DataListener
pDataItem
- item to handlepublic void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if an error occurred during the operationpublic void doStopService() throws ServiceException
doStopService
in class GenericService
ServiceException
- if an error occurredpublic void flush()
flush
in interface DataCollector
public void appendField(FormatField pFormatField, java.lang.Object pDataItem, java.lang.StringBuffer pBuffer)
pFormatField
- format field to usepDataItem
- bean whose property we are appendingpBuffer
- buffer to which we appendFormatField
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |