atg.service.datacollection
Class FormattingFileLogger

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.service.datacollection.FormattingLogger
              extended by atg.service.datacollection.FormattingFileLogger
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, LogListener, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, DataCollector, DataListener, Schedulable, java.util.EventListener

public class FormattingFileLogger
extends FormattingLogger
implements Schedulable

A FormattingLogger that logs items to the named file.


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
FormattingFileLogger()
           
 
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.
 java.lang.String getJobDescription()
          Returns property JobDescription
 java.lang.String getJobName()
          Returns property JobName
 java.io.File getLogFileDir()
          Returns property LogFileDir
 java.lang.String getLogFileExtension()
          Returns property LogFileExtension
 java.lang.String getLogFileName()
          Returns property LogFileName
 Schedule getSchedule()
          Returns property Schedule
 Scheduler getScheduler()
          Returns property Scheduler
 java.lang.String getTimestampDateFormat()
          Returns property TimestampDateFormat
 boolean isTimestampLogFileName()
          Returns property TimestampLogFileName
 void open()
          Opens the log media for writing to (if applicable).
 void performScheduledTask(Scheduler pScheduler, ScheduledJob pJob)
          Callback method for the scheduler.
 void rotate()
          Flush the current entries into the file.
 void setJobDescription(java.lang.String pJobDescription)
          Sets property JobDescription
 void setJobName(java.lang.String pJobName)
          Sets property JobName
 void setLogFileDir(java.io.File pLogFileDir)
          Sets property LogFileDir
 void setLogFileExtension(java.lang.String pLogFileExtension)
          Sets property LogFileExtension
 void setLogFileName(java.lang.String pLogFileName)
          Sets property LogFileName
 void setSchedule(Schedule pSchedule)
          Sets property Schedule
 void setScheduler(Scheduler pScheduler)
          Sets property Scheduler
 void setTimestampDateFormat(java.lang.String pTimestampDateFormat)
          Sets property TimestampDateFormat
 void setTimestampLogFileName(boolean pTimestampLogFileName)
          Sets property TimestampLogFileName
 
Methods inherited from class atg.service.datacollection.FormattingLogger
addDataItem, appendField, flush, getCount, getFieldDelimiter, getFormatFields, getLineTerminator, isSkipNullObject, isValidFormatField, isValidFormatVariable, logEvent, sanitizeFormatFields, setFieldDelimiter, setFormatFields, setLineTerminator, setSkipNullObject
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, 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, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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

FormattingFileLogger

public FormattingFileLogger()
Method Detail

setScheduler

public void setScheduler(Scheduler pScheduler)
Sets property Scheduler


getScheduler

public Scheduler getScheduler()
Returns property Scheduler


setSchedule

public void setSchedule(Schedule pSchedule)
Sets property Schedule


getSchedule

public Schedule getSchedule()
Returns property Schedule


setJobName

public void setJobName(java.lang.String pJobName)
Sets property JobName


getJobName

public java.lang.String getJobName()
Returns property JobName


setJobDescription

public void setJobDescription(java.lang.String pJobDescription)
Sets property JobDescription


getJobDescription

public java.lang.String getJobDescription()
Returns property JobDescription


setLogFileName

public void setLogFileName(java.lang.String pLogFileName)
Sets property LogFileName


getLogFileName

public java.lang.String getLogFileName()
Returns property LogFileName


setLogFileDir

public void setLogFileDir(java.io.File pLogFileDir)
Sets property LogFileDir


getLogFileDir

public java.io.File getLogFileDir()
Returns property LogFileDir


setLogFileExtension

public void setLogFileExtension(java.lang.String pLogFileExtension)
Sets property LogFileExtension


getLogFileExtension

public java.lang.String getLogFileExtension()
Returns property LogFileExtension


setTimestampLogFileName

public void setTimestampLogFileName(boolean pTimestampLogFileName)
Sets property TimestampLogFileName


isTimestampLogFileName

public boolean isTimestampLogFileName()
Returns property TimestampLogFileName


setTimestampDateFormat

public void setTimestampDateFormat(java.lang.String pTimestampDateFormat)
Sets property TimestampDateFormat


getTimestampDateFormat

public java.lang.String getTimestampDateFormat()
Returns property TimestampDateFormat


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 FormattingLogger
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 FormattingLogger
Throws:
ServiceException - if an error occurred during the operation

performScheduledTask

public void performScheduledTask(Scheduler pScheduler,
                                 ScheduledJob pJob)
Callback method for the scheduler. Flush out our summarized data.

Specified by:
performScheduledTask in interface Schedulable
Parameters:
pScheduler - calling the job
pJob - the ScheduledJob

rotate

public void rotate()
Flush the current entries into the file. Closes the file and then opens a new file


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