atg.nucleus.logging
Class FileLogger

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.logging.DisplayLogger
              extended by atg.nucleus.logging.FileLogger
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:
RotatingFileLogger

public class FileLogger
extends DisplayLogger

This log listener writes the logged events directly out to the configured log file.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 java.lang.String mLogFileName
          The name of the log file.
 java.io.File mLogFilePath
          The file path to the log file (filename not included).
 
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
FileLogger()
          Constructs a FileLogger.
 
Method Summary
 void close()
          Closes the log media cleanly (if applicable).
 void doStartService()
          This is called after the service has been created, added to the Registry, and configured.
 void doStopService()
          This is called when the service is to be stopped.
 void flush()
          Flushes the log media (if applicable).
 java.lang.String getLogFileName()
          Returns the name of the log file.
 java.io.File getLogFilePath()
          Returns the complete path to the log file (filename not included).
 void open()
          Opens the log media for writing to (if applicable).
 void setLogFileName(java.lang.String pLogFileName)
          Sets the name of the log file.
 void setLogFilePath(java.io.File pLogFilePath)
          Sets the complete path to the log file (filename not included).
 
Methods inherited from class atg.nucleus.logging.DisplayLogger
generateCroppedStackTrace, getLoggingEnabled, getLogStream, getMaxLinesInStackTrace, getPrefixLogStream, getPrintStackTrace, getWrittenEventCount, isCropStackTrace, isPrefixEachLine, isPrefixEachMessage, isSuppressTimestamp, logEvent, setCropStackTrace, setLoggingEnabled, setLogStream, setMaxLinesInStackTrace, setPrefixEachLine, setPrefixEachMessage, setPrefixLogStream, setPrintStackTrace, setSuppressTimestamp, writeLogEvent
 
Methods inherited from class atg.nucleus.GenericService
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
 
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


mLogFileName

public java.lang.String mLogFileName
The name of the log file.


mLogFilePath

public java.io.File mLogFilePath
The file path to the log file (filename not included).

Constructor Detail

FileLogger

public FileLogger()
Constructs a FileLogger.

Method Detail

setLogFileName

public void setLogFileName(java.lang.String pLogFileName)
Sets the name of the log file.

Parameters:
pLogFileName - the log file name

setLogFilePath

public void setLogFilePath(java.io.File pLogFilePath)
Sets the complete path to the log file (filename not included).

Parameters:
pLogFilePath - the log file path

getLogFileName

public java.lang.String getLogFileName()
Returns the name of the log file.

Returns:
String

getLogFilePath

public java.io.File getLogFilePath()
Returns the complete path to the log file (filename not included).

Returns:
File

doStartService

public void doStartService()
                    throws ServiceException
This is called after the service has been created, added to the Registry, and configured. This method should start any processes required to run the service.

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if an error occurred during the operation

doStopService

public void doStopService()
                   throws ServiceException
This is called when the service is to be stopped. The service should stop any processes that it started, basically performing the opposite function as startService(). The service should also release any resources it has. After this method is called, Nucleus may choose to discard the service.

Overrides:
doStopService in class GenericService
Throws:
ServiceException - if an error occurred during the operation

open

public void open()
          throws java.io.IOException
Opens the log media for writing to (if applicable).

Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Closes the log media cleanly (if applicable).

Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Flushes the log media (if applicable).

Throws:
java.io.IOException