RollingFileAppender Class Reference

Inherits RollingFileAppenderSkeleton.

List of all members.


Detailed Description

RollingFileAppender extends FileAppender to backup the log files when they reach a certain size.


Public Member Functions

 RollingFileAppender ()
 The default constructor simply calls its parents constructor.
 RollingFileAppender (const LayoutPtr &layout, const LogString &fileName, bool append)
 Instantiate a RollingFileAppender and open the file designated by filename.
 RollingFileAppender (const LayoutPtr &layout, const LogString &fileName)
 Instantiate a FileAppender and open the file designated by filename.
virtual ~RollingFileAppender ()
int getMaxBackupIndex () const
 Returns the value of the MaxBackupIndex option.
long getMaximumFileSize () const
 Get the maximum size that the output file is allowed to reach before being rolled over to backup files.
void setMaxBackupIndex (int maxBackupIndex)
 Set the maximum number of backup files to keep around.
void setMaxFileSize (const LogString &value)
 Set the maximum size that the output file is allowed to reach before being rolled over to backup files.
void setMaximumFileSize (int value)
virtual void setOption (const LogString &option, const LogString &value)
 Set option to value.
void activateOptions (log4cxx::helpers::Pool &pool)
 Prepares RollingFileAppender for use.


Constructor & Destructor Documentation

RollingFileAppender  ) 
 

The default constructor simply calls its parents constructor.

RollingFileAppender const LayoutPtr layout,
const LogString fileName,
bool  append
 

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 const LayoutPtr layout,
const LogString fileName
 

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.

virtual ~RollingFileAppender  )  [virtual]
 


Member Function Documentation

void activateOptions log4cxx::helpers::Pool pool  )  [virtual]
 

Prepares RollingFileAppender for use.

Reimplemented from RollingFileAppenderSkeleton.

int getMaxBackupIndex  )  const
 

Returns the value of the MaxBackupIndex option.

long getMaximumFileSize  )  const
 

Get the maximum size that the output file is allowed to reach before being rolled over to backup files.

void setMaxBackupIndex int  maxBackupIndex  ) 
 

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.

void setMaxFileSize const LogString value  ) 
 

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.

void setMaximumFileSize int  value  ) 
 

virtual void setOption const LogString option,
const LogString value
[virtual]
 

Set option to value.

The handling of each option depends on the OptionHandler instance. Some options may become active immediately whereas other may be activated only when activateOptions is called.

Reimplemented from FileAppender.


The documentation for this class was generated from the following file: