Class RollingFileAppender

java.lang.Object
com.enterprisedt.util.debug.FileAppender
com.enterprisedt.util.debug.RollingFileAppender
All Implemented Interfaces:
Appender

public class RollingFileAppender extends FileAppender
Rolling file appender that moves the log file to a backup file once it exceeds a certain size.
Version:
$Revision$
Author:
Bruce Blackshaw
  • Field Details

  • Constructor Details

    • RollingFileAppender

      public RollingFileAppender(String file, long maxFileSize) throws IOException
      Constructor
      Parameters:
      file - file to log to
      maxFileSize - maximum size of log file in bytes
      Throws:
      IOException
    • RollingFileAppender

      public RollingFileAppender(String file) throws IOException
      Constructor
      Parameters:
      file - file to log to
      Throws:
      IOException
  • Method Details

    • getMaxSizeRollBackups

      public int getMaxSizeRollBackups()
      Get the max size of a backup file
      Returns:
      int
    • setMaxSizeRollBackups

      public void setMaxSizeRollBackups(int maxSizeRollBackups)
      Set the maximum number of backup files
      Parameters:
      maxSizeRollBackups - number of files
    • getMaxFileSize

      public long getMaxFileSize()
      Get the maximum number of backup files
      Returns:
      int
    • log

      public void log(String msg)
      Log a message
      Specified by:
      log in interface Appender
      Overrides:
      log in class FileAppender
      Parameters:
      msg - message to log
    • log

      public void log(Throwable t)
      Description copied from interface: Appender
      Log a stack trace
      Specified by:
      log in interface Appender
      Overrides:
      log in class FileAppender
      Parameters:
      t - throwable object