RollingPolicy Class Referenceabstract

A `RollingPolicy` is responsible for performing the rolling over of the active log file. More...

Inherits OptionHandler.

Inherited by RollingPolicyBase`[virtual]`.

## Public Member Functions

virtual | ~RollingPolicy ()
virtual RolloverDescriptionPtr | initialize (const LogString &file, const bool append, log4cxx::helpers::Pool &p)=0
| Initialize the policy and return any initial actions for rolling file appender. More...
virtual RolloverDescriptionPtr | rollover (const LogString &activeFile, log4cxx::helpers::Pool &p)=0
| Prepare for a rollover. More...
Public Member Functions inherited from OptionHandler
virtual | ~OptionHandler ()
virtual void | activateOptions (log4cxx::helpers::Pool &p)=0
| Activate the options that were previously set with calls to option setters. More...
virtual void | setOption (const LogString &option, const LogString &value)=0
| Set `option` to `value`. More...
Public Member Functions inherited from Object
virtual const helpers::Class & | getClass () const
virtual | ~Object ()
virtual void | addRef () const =0
virtual void | releaseRef () const =0
virtual bool | instanceof (const Class &clazz) const =0
virtual const void * | cast (const Class &clazz) const =0

## Additional Inherited Members

Static Public Member Functions inherited from Object
static const helpers::Class & | getStaticClass ()
static const log4cxx::helpers::ClassRegistration & | registerClass ()

## Detailed Description

A `RollingPolicy` is responsible for performing the rolling over of the active log file.

The `RollingPolicy` is also responsible for providing the active log file, that is the live file where logging output will be directed.

## Constructor & Destructor Documentation

virtual ~RollingPolicy | ( |  | ) |

inline virtual

## Member Function Documentation

virtual RolloverDescriptionPtr initialize | ( | const LogString & | file,
|  | const bool | append,
|  | log4cxx::helpers::Pool & | p
| ) |  |

pure virtual

Initialize the policy and return any initial actions for rolling file appender.

Parameters

  file | current value of RollingFileAppender.getFile().
  append | current value of RollingFileAppender.getAppend().
  p | pool for memory allocations during call.

Returns
  Description of the initialization, may be null to indicate no initialization needed.

Exceptions

  SecurityException | if denied access to log files.

Implemented in TimeBasedRollingPolicy, and FixedWindowRollingPolicy.

virtual RolloverDescriptionPtr rollover | ( | const LogString & | activeFile,
|  | log4cxx::helpers::Pool & | p
| ) |  |

pure virtual

Prepare for a rollover.

This method is called prior to closing the active log file, performs any necessary preliminary actions and describes actions needed after close of current log file.

Parameters

  activeFile | file name for current active log file.
  p | pool for memory allocations during call.

Returns
  Description of pending rollover, may be null to indicate no rollover at this time.

Exceptions

  SecurityException | if denied access to log files.

Implemented in TimeBasedRollingPolicy, and FixedWindowRollingPolicy.

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

- rollingpolicy.h