|
|||||||||
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.nucleus.logging.DisplayLogger atg.nucleus.logging.FileLogger atg.nucleus.logging.RotatingFileLogger
public class RotatingFileLogger
This subclass of FileLogger will "rotate" logs according to a schedule. When the logs are rotated, the current log is compressed, "zipped", and written to the logArchivePath, with the name "{logfile}.0.zip". If there is already a "{logfile}.0.zip" in existence, then it is renamed to "{logfile}.1.zip", and so on. A maximum archive count specifies the highest numbered log file to be stored, after which the oldest archive files are removed.
Log files are only "zipped" if the "archiveCompressed" flag is set to true. Otherwise, the log files are copied as-is, and do not have the ".zip" extension.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from class atg.nucleus.logging.FileLogger |
---|
mLogFileName, mLogFilePath |
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 | |
---|---|
RotatingFileLogger()
Constructs a new RotatingFileLogger |
Method Summary | |
---|---|
void |
doStartService()
Schedules the rotation |
void |
doStopService()
Unschedules the rotation |
java.io.File |
getLogArchivePath()
Returns the path used to store rotated log archives |
int |
getMaximumArchiveCount()
Returns the maximum number of archived files that will be kept for this file. |
Schedule |
getSchedule()
Returns the Schedule that is used to schedule rotations |
Scheduler |
getScheduler()
Returns the Scheduler that is used to schedule rotations |
boolean |
isArchiveCompressed()
Returns the flag indicating if the archive files are compressed when rotated. |
void |
performScheduledTask(Scheduler pScheduler,
ScheduledJob pJob)
Performs the log rotation |
void |
rotateCompressedLogs()
Rotates the compressed log files |
void |
rotateLogs()
Rotates the log files |
void |
rotateUncompressedLogs()
Rotates the uncompressed log files |
void |
setArchiveCompressed(boolean pArchiveCompressed)
Sets the flag indicating if the archive files are compressed when rotated. |
void |
setLogArchivePath(java.io.File pLogArchivePath)
Sets the path used to store rotated log archives |
void |
setMaximumArchiveCount(int pMaximumArchiveCount)
Sets the maximum number of archived files that will be kept for this file. |
void |
setSchedule(Schedule pSchedule)
Sets the Schedule that is used to schedule rotations |
void |
setScheduler(Scheduler pScheduler)
Sets the Scheduler that is used to schedule rotations |
Methods inherited from class atg.nucleus.logging.FileLogger |
---|
close, flush, getLogFileName, getLogFilePath, open, setLogFileName, setLogFilePath |
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 |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public RotatingFileLogger()
Method Detail |
---|
public Scheduler getScheduler()
public void setScheduler(Scheduler pScheduler)
public Schedule getSchedule()
public void setSchedule(Schedule pSchedule)
public java.io.File getLogArchivePath()
public void setLogArchivePath(java.io.File pLogArchivePath)
public int getMaximumArchiveCount()
public void setMaximumArchiveCount(int pMaximumArchiveCount)
public boolean isArchiveCompressed()
public void setArchiveCompressed(boolean pArchiveCompressed)
public void doStartService() throws ServiceException
doStartService
in class FileLogger
ServiceException
- if an error occurred during the operationpublic void doStopService() throws ServiceException
doStopService
in class FileLogger
ServiceException
- if an error occurred during the operationpublic void performScheduledTask(Scheduler pScheduler, ScheduledJob pJob)
performScheduledTask
in interface Schedulable
pScheduler
- calling the jobpJob
- the ScheduledJobpublic void rotateLogs()
public void rotateUncompressedLogs()
public void rotateCompressedLogs()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |