edtFTPj/Free - Open-source FTP library for Java | Download


com.enterprisedt.util.debug
Class RollingFileAppender

java.lang.Object
  extended by com.enterprisedt.util.debug.FileAppender
      extended by 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: 1.4 $
Author:
Bruce Blackshaw

Field Summary
static java.lang.String cvsId
          Revision control id
 
Fields inherited from class com.enterprisedt.util.debug.FileAppender
closed, log
 
Constructor Summary
RollingFileAppender(java.lang.String file)
          Constructor
RollingFileAppender(java.lang.String file, long maxFileSize)
          Constructor
 
Method Summary
 long getMaxFileSize()
          Get the maximum number of backup files
 int getMaxSizeRollBackups()
          Get the max size of a backup file
 void log(java.lang.String msg)
          Log a message
 void log(java.lang.Throwable t)
          Log a stack trace
 void setMaxSizeRollBackups(int maxSizeRollBackups)
          Set the maximum number of backup files
 
Methods inherited from class com.enterprisedt.util.debug.FileAppender
close, getFile, open
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cvsId

public static final java.lang.String cvsId
Revision control id

See Also:
Constant Field Values
Constructor Detail

RollingFileAppender

public RollingFileAppender(java.lang.String file,
                           long maxFileSize)
                    throws java.io.IOException
Constructor

Parameters:
file - file to log to
maxFileSize - maximum size of log file in bytes
Throws:
java.io.IOException

RollingFileAppender

public RollingFileAppender(java.lang.String file)
                    throws java.io.IOException
Constructor

Parameters:
file - file to log to
Throws:
java.io.IOException
Method Detail

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(java.lang.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(java.lang.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


Copyright (c) 2001-2007 Enterprise Distributed Technologies Ltd. All Rights Reserved.