com.metamatrix.core.log
Class FileLimitSizeLogWriter

java.lang.Object
  extended by com.metamatrix.core.log.FileLimitSizeLogWriter
All Implemented Interfaces:
LogListener

public class FileLimitSizeLogWriter
extends java.lang.Object
implements LogListener

The FileLogWriter is a LogListener that writes (appends) to a supplied file.


Field Summary
static java.lang.String ARCHIVE_PREFIX
          The ARCHIVE_PREFIX is a prefixed value to the renamed log file.
static java.lang.String FILE_SIZE_LIMIT
          The FILE_SIZE_LIMIT controls the file size limit at which the file will rolled-over (i.e., when it closed and renamed due to size).
static java.lang.String FILE_SIZE_MONITOR_TIME
          the FILE_SIZE_MONITOR_TIME interval is in minutes and controls when the monitoring thread will determine if the file has reach the LIMIT to be swapped out.
static java.lang.String TIMESTAMP_FORMAT
           
 
Constructor Summary
FileLimitSizeLogWriter(java.io.File file)
           
FileLimitSizeLogWriter(java.io.File file, boolean resetSystemStreams)
           
FileLimitSizeLogWriter(java.io.File file, java.util.Properties properties)
           
FileLimitSizeLogWriter(java.io.File file, java.util.Properties properties, boolean rollover)
           
 
Method Summary
static java.lang.String buildArchiveFileName(java.lang.String prefix, java.lang.String suffix)
           
protected  void createPlatformLogWriter(java.io.File file)
           
protected  void createPlatformLogWriter(java.io.File file, boolean resetSystemStreams)
           
protected static java.lang.String getDate()
           
protected  java.io.File getLogFile()
           
protected  com.metamatrix.internal.core.log.PlatformLimitSizeLogWriter getPlatformLogWriter()
           
 void logMessage(LogMessage msg)
          Notifies this listener that given status has been logged.
protected  void performRollOver()
          perform the file rollover process
protected  void rolloverFile(java.io.File rollToFile)
           
 void shutdown()
          Close the stream to the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_SIZE_LIMIT

public static final java.lang.String FILE_SIZE_LIMIT
The FILE_SIZE_LIMIT controls the file size limit at which the file will rolled-over (i.e., when it closed and renamed due to size). The default size limit will be 5 Mbs. #FILE_GROUP_NAME

See Also:
Constant Field Values

FILE_SIZE_MONITOR_TIME

public static final java.lang.String FILE_SIZE_MONITOR_TIME
the FILE_SIZE_MONITOR_TIME interval is in minutes and controls when the monitoring thread will determine if the file has reach the LIMIT to be swapped out.

See Also:
Constant Field Values

ARCHIVE_PREFIX

public static final java.lang.String ARCHIVE_PREFIX
The ARCHIVE_PREFIX is a prefixed value to the renamed log file. This is used so that the savelogs.cmd - .sh scripts can find the archived files, zip them up and then delete

See Also:
Constant Field Values

TIMESTAMP_FORMAT

public static final java.lang.String TIMESTAMP_FORMAT
See Also:
Constant Field Values
Constructor Detail

FileLimitSizeLogWriter

public FileLimitSizeLogWriter(java.io.File file)

FileLimitSizeLogWriter

public FileLimitSizeLogWriter(java.io.File file,
                              boolean resetSystemStreams)

FileLimitSizeLogWriter

public FileLimitSizeLogWriter(java.io.File file,
                              java.util.Properties properties)

FileLimitSizeLogWriter

public FileLimitSizeLogWriter(java.io.File file,
                              java.util.Properties properties,
                              boolean rollover)
Method Detail

getLogFile

protected java.io.File getLogFile()

createPlatformLogWriter

protected void createPlatformLogWriter(java.io.File file)

createPlatformLogWriter

protected void createPlatformLogWriter(java.io.File file,
                                       boolean resetSystemStreams)

getPlatformLogWriter

protected com.metamatrix.internal.core.log.PlatformLimitSizeLogWriter getPlatformLogWriter()

logMessage

public void logMessage(LogMessage msg)
Description copied from interface: LogListener
Notifies this listener that given status has been logged. The listener is free to retain or ignore this status.

Specified by:
logMessage in interface LogListener

performRollOver

protected void performRollOver()
perform the file rollover process


shutdown

public void shutdown()
Close the stream to the file.

Specified by:
shutdown in interface LogListener

rolloverFile

protected void rolloverFile(java.io.File rollToFile)

buildArchiveFileName

public static java.lang.String buildArchiveFileName(java.lang.String prefix,
                                                    java.lang.String suffix)

getDate

protected static java.lang.String getDate()


Copyright © 2009. All Rights Reserved.