Log4j 1.3alpha-7

org.apache.log4j
Class RollingFileAppender

java.lang.Object
  extended byorg.apache.log4j.RollingFileAppender
All Implemented Interfaces:
Appender, Component, OptionHandler
Direct Known Subclasses:
ExternallyRolledFileAppender

Deprecated. Replaced by RollingFileAppender

public class RollingFileAppender
extends Object
implements Appender, OptionHandler

org.apache.log4j.RollingFileAppender emulates earlier implementations by delegating to general purpose org.apache.log4j.rollling.RollingFileAppender introduced in log4j 1.3. This class is provided for compatibility with existing configuration files but is not intended to be compatible with existing extensions of the prior RollingFileAppender and is marked final to prevent such use.

Author:
Curt Arnold

Constructor Summary
RollingFileAppender()
          Deprecated. The default constructor simply calls its parents constructor.
RollingFileAppender(Layout layout, String filename)
          Deprecated. Instantiate a FileAppender and open the file designated by filename.
RollingFileAppender(Layout layout, String filename, boolean append)
          Deprecated. Instantiate a RollingFileAppender and open the file designated by filename.
 
Method Summary
 void activateOptions()
          Deprecated. Prepares RollingFileAppender for use.
 void addFilter(Filter newFilter)
          Deprecated. Add a filter to the end of the filter list.
 void clearFilters()
          Deprecated. Clear the list of filters by removing all the filters in it.
 void close()
          Deprecated. Release any resources allocated within the appender such as file handles, network connections, etc.
 void doAppend(LoggingEvent event)
          Deprecated. Log in Appender specific way.
 boolean getAppend()
          Deprecated. Returns the value of the Append option.
 boolean getBufferedIO()
          Deprecated. Get the value of the BufferedIO option.
 int getBufferSize()
          Deprecated. Get the size of the IO buffer.
 ErrorHandler getErrorHandler()
          Deprecated. As of 1.3
 String getFile()
          Deprecated. Returns the value of the File option.
 Filter getFilter()
          Deprecated. Returns the head Filter.
 Layout getLayout()
          Deprecated. Returns this appenders layout.
 int getMaxBackupIndex()
          Deprecated. Returns the value of the MaxBackupIndex option.
 long getMaximumFileSize()
          Deprecated. Get the maximum size that the output file is allowed to reach before being rolled over to backup files.
 String getName()
          Deprecated. Get the name of this appender.
 boolean isActive()
          Deprecated. Is this appender in working order?
 boolean isClosed()
          Deprecated. Is this appender closed?
 void rollOver()
          Deprecated. Implements the usual roll over behaviour.
 void setAppend(boolean flag)
          Deprecated. The Append option takes a boolean value.
 void setBufferedIO(boolean bufferedIO)
          Deprecated. The BufferedIO option takes a boolean value.
 void setBufferSize(int bufferSize)
          Deprecated. Set the size of the IO buffer.
 void setErrorHandler(ErrorHandler eh)
          Deprecated. As of 1.3
 void setFile(String file)
          Deprecated. The File property takes a string value which should be the name of the file to append to.
 void setLayout(Layout layout)
          Deprecated. Set the Layout for this appender.
 void setLoggerRepository(LoggerRepository repository)
          Deprecated. Set owning logger repository for this component.
 void setMaxBackupIndex(int maxBackups)
          Deprecated. Set the maximum number of backup files to keep around.
 void setMaxFileSize(String value)
          Deprecated. Set the maximum size that the output file is allowed to reach before being rolled over to backup files.
 void setMaximumFileSize(long maxFileSize)
          Deprecated. Set the maximum size that the output file is allowed to reach before being rolled over to backup files.
 void setName(String name)
          Deprecated. Set the name of this appender.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RollingFileAppender

public RollingFileAppender()
Deprecated. 
The default constructor simply calls its parents constructor.


RollingFileAppender

public RollingFileAppender(Layout layout,
                           String filename,
                           boolean append)
                    throws IOException
Deprecated. 
Instantiate a RollingFileAppender and open the file designated by filename. The opened filename will become the ouput destination for this appender.

If the append parameter is true, the file will be appended to. Otherwise, the file desginated by filename will be truncated before being opened.


RollingFileAppender

public RollingFileAppender(Layout layout,
                           String filename)
                    throws IOException
Deprecated. 
Instantiate a FileAppender and open the file designated by filename. The opened filename will become the output destination for this appender.

The file will be appended to.

Method Detail

getMaxBackupIndex

public int getMaxBackupIndex()
Deprecated. 
Returns the value of the MaxBackupIndex option.


getMaximumFileSize

public long getMaximumFileSize()
Deprecated. 
Get the maximum size that the output file is allowed to reach before being rolled over to backup files.

Since:
1.1

setMaxBackupIndex

public void setMaxBackupIndex(int maxBackups)
Deprecated. 
Set the maximum number of backup files to keep around.

The MaxBackupIndex option determines how many backup files are kept before the oldest is erased. This option takes a positive integer value. If set to zero, then there will be no backup files and the log file will be truncated when it reaches MaxFileSize.


setMaximumFileSize

public void setMaximumFileSize(long maxFileSize)
Deprecated. 
Set the maximum size that the output file is allowed to reach before being rolled over to backup files.

This method is equivalent to setMaxFileSize(java.lang.String) except that it is required for differentiating the setter taking a long argument from the setter taking a String argument by the JavaBeans Introspector.

See Also:
setMaxFileSize(String)

setMaxFileSize

public void setMaxFileSize(String value)
Deprecated. 
Set the maximum size that the output file is allowed to reach before being rolled over to backup files.

In configuration files, the MaxFileSize option takes an long integer in the range 0 - 2^63. You can specify the value with the suffixes "KB", "MB" or "GB" so that the integer is interpreted being expressed respectively in kilobytes, megabytes or gigabytes. For example, the value "10KB" will be interpreted as 10240.


activateOptions

public void activateOptions()
Deprecated. 
Prepares RollingFileAppender for use.

Specified by:
activateOptions in interface OptionHandler

addFilter

public void addFilter(Filter newFilter)
Deprecated. 
Add a filter to the end of the filter list.

Specified by:
addFilter in interface Appender
Since:
0.9.0

getFilter

public Filter getFilter()
Deprecated. 
Returns the head Filter. The Filters are organized in a linked list and so all Filters on this Appender are available through the result.

Specified by:
getFilter in interface Appender
Returns:
the head Filter or null, if no Filters are present
Since:
1.1

clearFilters

public void clearFilters()
Deprecated. 
Clear the list of filters by removing all the filters in it.

Specified by:
clearFilters in interface Appender
Since:
0.9.0

close

public void close()
Deprecated. 
Release any resources allocated within the appender such as file handles, network connections, etc.

It is a programming error to append to a closed appender.

Specified by:
close in interface Appender
Since:
0.8.4

isClosed

public boolean isClosed()
Deprecated. 
Is this appender closed?

Since:
1.3

isActive

public boolean isActive()
Deprecated. 
Is this appender in working order?

Since:
1.3

doAppend

public void doAppend(LoggingEvent event)
Deprecated. 
Log in Appender specific way. When appropriate, Loggers will call the doAppend method of appender implementations in order to log.

Specified by:
doAppend in interface Appender

getName

public String getName()
Deprecated. 
Get the name of this appender. The name uniquely identifies the appender.

Specified by:
getName in interface Appender

setLayout

public void setLayout(Layout layout)
Deprecated. 
Set the Layout for this appender.

Specified by:
setLayout in interface Appender
Since:
0.8.1

getLayout

public Layout getLayout()
Deprecated. 
Returns this appenders layout.

Specified by:
getLayout in interface Appender
Since:
1.1

setName

public void setName(String name)
Deprecated. 
Set the name of this appender. The name is used by other components to identify this appender.

Specified by:
setName in interface Appender
Since:
0.8.1

setLoggerRepository

public void setLoggerRepository(LoggerRepository repository)
                         throws IllegalStateException
Deprecated. 
Description copied from interface: Component
Set owning logger repository for this component. This operation can only be performed once. Once set, the owning repository cannot be changed.

Specified by:
setLoggerRepository in interface Appender
Throws:
IllegalStateException

setFile

public void setFile(String file)
Deprecated. 
The File property takes a string value which should be the name of the file to append to.

Note that the special values "System.out" or "System.err" are no longer honored.

Note: Actual opening of the file is made when activateOptions() is called, not when the options are set.


getAppend

public boolean getAppend()
Deprecated. 
Returns the value of the Append option.


getFile

public String getFile()
Deprecated. 
Returns the value of the File option.


getBufferedIO

public boolean getBufferedIO()
Deprecated. 
Get the value of the BufferedIO option.

BufferedIO will significatnly increase performance on heavily loaded systems.


getBufferSize

public int getBufferSize()
Deprecated. 
Get the size of the IO buffer.


setAppend

public void setAppend(boolean flag)
Deprecated. 
The Append option takes a boolean value. It is set to true by default. If true, then File will be opened in append mode by setFile (see above). Otherwise, setFile will open File in truncate mode.

Note: Actual opening of the file is made when activateOptions() is called, not when the options are set.


setBufferedIO

public void setBufferedIO(boolean bufferedIO)
Deprecated. 
The BufferedIO option takes a boolean value. It is set to false by default. If true, then File will be opened and the resulting Writer wrapped around a BufferedWriter. BufferedIO will significatnly increase performance on heavily loaded systems.


setBufferSize

public void setBufferSize(int bufferSize)
Deprecated. 
Set the size of the IO buffer.


rollOver

public void rollOver()
Deprecated. 
Implements the usual roll over behaviour.

If MaxBackupIndex is positive, then files {File.1, ..., File.MaxBackupIndex -1} are renamed to {File.2, ..., File.MaxBackupIndex}. Moreover, File is renamed File.1 and closed. A new File is created to receive further log output.

If MaxBackupIndex is equal to zero, then the File is truncated with no backup files created.


getErrorHandler

public final ErrorHandler getErrorHandler()
Deprecated. As of 1.3

Return the hardcoded OnlyOnceErrorHandler for this Appender. ErrorHandler's are no longer utilized as of version 1.3.

Specified by:
getErrorHandler in interface Appender
Since:
0.9.0

setErrorHandler

public final void setErrorHandler(ErrorHandler eh)
Deprecated. As of 1.3

Ignored as of 1.3

Specified by:
setErrorHandler in interface Appender
Since:
0.9.0

Log4j 1.3alpha-7

Copyright 2000-2005 Apache Software Foundation.