atg.nucleus.logging
Class DisplayLogger

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.logging.DisplayLogger
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, LogListener, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener
Direct Known Subclasses:
FileLogger, PrintStreamLogger

public abstract class DisplayLogger
extends GenericService
implements LogListener

This is the base class for loggers which write to standard i/o devices such as a file or screen. It has properties which control the formatting of the output.


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
DisplayLogger()
           
 
Method Summary
protected  java.lang.String generateCroppedStackTrace(java.lang.Throwable pThrowable)
           
 boolean getLoggingEnabled()
           
protected  java.io.PrintStream getLogStream()
          return LogStream
 int getMaxLinesInStackTrace()
           
protected  atg.nucleus.logging.LogPrintStream getPrefixLogStream()
          return PrefixLogStream
 boolean getPrintStackTrace()
           
 int getWrittenEventCount()
          Returns the number of log events written.
 boolean isCropStackTrace()
          Returns property CropStackTrace
 boolean isPrefixEachLine()
           
 boolean isPrefixEachMessage()
           
 boolean isSuppressTimestamp()
          Returns True if each message should only be prefixed with an originator name.
 void logEvent(LogEvent pLogEvent)
          Writes the given log event out to the log stream.
 void setCropStackTrace(boolean pCropStackTrace)
          Sets property CropStackTrace, default is true
 void setLoggingEnabled(boolean pLoggingEnabled)
          Sets the property LoggingEnabled.
protected  void setLogStream(java.io.PrintStream pLogStream)
           
 void setMaxLinesInStackTrace(int pMaxLinesInStackTrace)
           
 void setPrefixEachLine(boolean pPrefixEachLine)
           
 void setPrefixEachMessage(boolean pPrefixEachMessage)
           
protected  void setPrefixLogStream(atg.nucleus.logging.LogPrintStream pPrefixLogStream)
           
 void setPrintStackTrace(boolean pPrintStackTrace)
          Sets the property PrintStackTrace.
 void setSuppressTimestamp(boolean pSuppressTimestamp)
           
 void writeLogEvent(LogEvent pLogEvent)
          Writes the given log event out to the log stream.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, 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
 
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

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

DisplayLogger

public DisplayLogger()
Method Detail

setCropStackTrace

public void setCropStackTrace(boolean pCropStackTrace)
Sets property CropStackTrace, default is true


isCropStackTrace

public boolean isCropStackTrace()
Returns property CropStackTrace


setMaxLinesInStackTrace

public void setMaxLinesInStackTrace(int pMaxLinesInStackTrace)

getMaxLinesInStackTrace

public int getMaxLinesInStackTrace()

setSuppressTimestamp

public void setSuppressTimestamp(boolean pSuppressTimestamp)

isSuppressTimestamp

public boolean isSuppressTimestamp()
Returns True if each message should only be prefixed with an originator name. Timestamp , date and identifier will not be displayed.


setPrefixEachMessage

public void setPrefixEachMessage(boolean pPrefixEachMessage)

isPrefixEachMessage

public boolean isPrefixEachMessage()

setPrefixEachLine

public void setPrefixEachLine(boolean pPrefixEachLine)

isPrefixEachLine

public boolean isPrefixEachLine()

setPrintStackTrace

public void setPrintStackTrace(boolean pPrintStackTrace)
Sets the property PrintStackTrace.


getPrintStackTrace

public boolean getPrintStackTrace()
Returns:
The value of the property PrintStackTrace.

getWrittenEventCount

public int getWrittenEventCount()
Returns the number of log events written.


setLoggingEnabled

public void setLoggingEnabled(boolean pLoggingEnabled)
Sets the property LoggingEnabled. If this value is false, this logger does not log anything.


getLoggingEnabled

public boolean getLoggingEnabled()
Returns:
The value of the property LoggingEnabled.

logEvent

public void logEvent(LogEvent pLogEvent)
Writes the given log event out to the log stream.

Specified by:
logEvent in interface LogListener
Parameters:
pLogEvent - the log event

writeLogEvent

public void writeLogEvent(LogEvent pLogEvent)
Writes the given log event out to the log stream. (Does the real work of logEvent.)

Parameters:
pLogEvent - the log event

generateCroppedStackTrace

protected java.lang.String generateCroppedStackTrace(java.lang.Throwable pThrowable)

getLogStream

protected java.io.PrintStream getLogStream()
return LogStream


setLogStream

protected void setLogStream(java.io.PrintStream pLogStream)

getPrefixLogStream

protected atg.nucleus.logging.LogPrintStream getPrefixLogStream()
return PrefixLogStream


setPrefixLogStream

protected void setPrefixLogStream(atg.nucleus.logging.LogPrintStream pPrefixLogStream)