public abstract class FormattingLogger extends GenericService implements DataCollector, LogListener
FormatField
,
FormattingSummaryLogger
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
FormattingLogger() |
Modifier and Type | Method and Description |
---|---|
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
|
addLogListener, createAdminServlet, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
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 testpublic boolean isValidFormatVariable(java.lang.String pName)
pName
- name to checkpublic 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