Apache Log4cxx  Version 2.0.0
Loading...
Searching...
No Matches
log4cxx::rolling::RollingPolicy Class Referenceabstract

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

#include <rollingpolicy.h>

Inheritance diagram for log4cxx::rolling::RollingPolicy:
log4cxx::spi::OptionHandler log4cxx::helpers::Object log4cxx::rolling::RollingPolicyBase log4cxx::rolling::FixedWindowRollingPolicy log4cxx::rolling::TimeBasedRollingPolicy

Public Member Functions

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

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

◆ ~RollingPolicy()

virtual log4cxx::rolling::RollingPolicy::~RollingPolicy ( )
inlinevirtual

Member Function Documentation

◆ initialize() [1/2]

virtual RolloverDescriptionPtr log4cxx::rolling::RollingPolicy::initialize ( const LogString & currentActiveFile,
bool append )
pure virtual

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

Parameters
currentActiveFilecurrent value of RollingFileAppender.getFile().
appendcurrent value of RollingFileAppender.getAppend().
Returns
Description of the initialization, may be null to indicate no initialization needed.

Implemented in log4cxx::rolling::FixedWindowRollingPolicy, and log4cxx::rolling::TimeBasedRollingPolicy.

◆ initialize() [2/2]

RolloverDescriptionPtr log4cxx::rolling::RollingPolicy::initialize ( const LogString & currentActiveFile,
bool append,
helpers::Pool & pool )
Deprecated
Backward compatability support will be removed in a future version.
Deprecated
Use initialize() without a Pool parameter instead

◆ rollover() [1/2]

virtual RolloverDescriptionPtr log4cxx::rolling::RollingPolicy::rollover ( const LogString & currentActiveFile,
bool append )
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
currentActiveFilefile name for current active log file.
appendcurrent value of the parent FileAppender.getAppend().
Returns
Description of pending rollover, may be null to indicate no rollover at this time.

Implemented in log4cxx::rolling::FixedWindowRollingPolicy, and log4cxx::rolling::TimeBasedRollingPolicy.

◆ rollover() [2/2]

RolloverDescriptionPtr log4cxx::rolling::RollingPolicy::rollover ( const LogString & currentActiveFile,
bool append,
helpers::Pool & pool )
Deprecated
Backward compatability support will be removed in a future version.
Deprecated
Use rollover() without a Pool parameter instead

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