Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions

RollingFileAppenderSkeleton Class Reference

Base class for log4cxx::rolling::RollingFileAppender and log4cxx::RollingFileAppender (analogues of org.apache.log4j.rolling.RFA from extras companion and org.apache.log4j.RFA from log4j 1.2, respectively). More...

Inherits log4cxx::FileAppender.

Inherited by DailyRollingFileAppender, RollingFileAppender, and RollingFileAppender.

List of all members.

Classes

class  ClazzRollingFileAppenderSkeleton

Public Member Functions

virtual const helpers::ClassgetClass () const
const void * cast (const helpers::Class &clazz) const
bool instanceof (const helpers::Class &clazz) const
 RollingFileAppenderSkeleton ()
 The default constructor simply calls its parents constructor.
void activateOptions (log4cxx::helpers::Pool &)
bool rollover (log4cxx::helpers::Pool &p)
 Implements the usual roll over behaviour.
void close ()
 Close appender.
size_t getFileLength () const
 Get byte length of current active log file.
void incrementFileLength (size_t increment)
 Increments estimated byte length of current active log file.

Static Public Member Functions

static const helpers::ClassgetStaticClass ()
static const
log4cxx::helpers::ClassRegistration
registerClass ()

Public Attributes

TriggeringPolicyPtr triggeringPolicy
 Triggering policy.
RollingPolicyPtr rollingPolicy
 Rolling policy.
size_t fileLength
 Length of current active log file.

Protected Member Functions

virtual void subAppend (const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &p)
 Actual writing occurs here.
RollingPolicyPtr getRollingPolicy () const
TriggeringPolicyPtr getTriggeringPolicy () const
void setRollingPolicy (const RollingPolicyPtr &policy)
 Sets the rolling policy.
void setTriggeringPolicy (const TriggeringPolicyPtr &policy)
log4cxx::helpers::WriterPtr createWriter (log4cxx::helpers::OutputStreamPtr &os)
 Returns an OutputStreamWriter when passed an OutputStream.

Detailed Description

Base class for log4cxx::rolling::RollingFileAppender and log4cxx::RollingFileAppender (analogues of org.apache.log4j.rolling.RFA from extras companion and org.apache.log4j.RFA from log4j 1.2, respectively).


Constructor & Destructor Documentation

The default constructor simply calls its parents constructor.


Member Function Documentation

void activateOptions ( log4cxx::helpers::Pool p  )  [virtual]

Sets and opens the file where the log output will go. The specified file must be writable.

If there was already an opened file, then the previous file is closed first.

Reimplemented from FileAppender.

Reimplemented in DailyRollingFileAppender, and RollingFileAppender.

const void* cast ( const helpers::Class clazz  )  const [inline, virtual]

Reimplemented from WriterAppender.

Reimplemented in RollingFileAppender.

void close (  )  [virtual]

Close appender.

Waits for any asynchronous file compression actions to be completed.

Reimplemented from WriterAppender.

log4cxx::helpers::WriterPtr createWriter ( log4cxx::helpers::OutputStreamPtr &  os  )  [protected, virtual]

Returns an OutputStreamWriter when passed an OutputStream.

The encoding used will depend on the value of the encoding property. If the encoding value is specified incorrectly the writer will be opened using the default system encoding (an error message will be printed to the loglog.

Parameters:
os output stream, may not be null.
Returns:
new writer.

Reimplemented from WriterAppender.

virtual const helpers::Class& getClass (  )  const [virtual]

Reimplemented from WriterAppender.

Reimplemented in RollingFileAppender.

size_t getFileLength (  )  const

Get byte length of current active log file.

Returns:
byte length of current active log file.
RollingPolicyPtr getRollingPolicy (  )  const [protected]
static const helpers::Class& getStaticClass (  )  [static]

Reimplemented from WriterAppender.

Reimplemented in RollingFileAppender.

TriggeringPolicyPtr getTriggeringPolicy (  )  const [protected]
void incrementFileLength ( size_t  increment  ) 

Increments estimated byte length of current active log file.

Parameters:
increment additional bytes written to log file.
bool instanceof ( const helpers::Class clazz  )  const [inline, virtual]

Reimplemented from WriterAppender.

Reimplemented in RollingFileAppender.

static const log4cxx::helpers::ClassRegistration& registerClass (  )  [static]

Reimplemented from WriterAppender.

Reimplemented in RollingFileAppender.

bool rollover ( log4cxx::helpers::Pool p  ) 

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.

void setRollingPolicy ( const RollingPolicyPtr policy  )  [protected]

Sets the rolling policy.

In case the 'policy' argument also implements TriggeringPolicy, then the triggering policy for this appender is automatically set to be the policy argument.

Parameters:
policy 
void setTriggeringPolicy ( const TriggeringPolicyPtr policy  )  [protected]
virtual void subAppend ( const spi::LoggingEventPtr event,
log4cxx::helpers::Pool p 
) [protected, virtual]

Actual writing occurs here.

Reimplemented from WriterAppender.


Member Data Documentation

size_t fileLength

Length of current active log file.

Rolling policy.

Triggering policy.


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