Apache Log4cxx  Version 1.8.0
log4cxx::rolling::RollingPolicyBase Class Referenceabstract

Implements methods common to most, it not all, rolling policies. More...

#include <rollingpolicybase.h>

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

Public Member Functions

 RollingPolicyBase ()
 
virtual ~RollingPolicyBase ()
 
void activateOptions (helpers::Pool &p) override
 
virtual pattern::PatternMap getFormatSpecifiers () const =0
 A map from a name to the object implementing the (date or index) formatting. More...
 
void setOption (const LogString &option, const LogString &value) override
 Set option to value. More...
 
void setFileNamePattern (const LogString &fnp)
 Set file name pattern. More...
 
LogString getFileNamePattern () const
 Get file name pattern. More...
 
bool getCreateIntermediateDirectories () const
 
void setCreateIntermediateDirectories (bool createIntermediate)
 
PatternConverterList getPatternConverterList () const
 
- Public Member Functions inherited from log4cxx::rolling::RollingPolicy
virtual ~RollingPolicy ()
 
RolloverDescriptionPtr initialize (const LogString &currentActiveFile, bool append)
 Initialize the policy and return any initial actions for rolling file appender. More...
 
virtual RolloverDescriptionPtr initialize (const LogString &currentActiveFile, const bool append, log4cxx::helpers::Pool &pool)=0
 
RolloverDescriptionPtr rollover (const LogString &currentActiveFile, bool append)
 Prepare for a rollover. More...
 
virtual RolloverDescriptionPtr rollover (const LogString &currentActiveFile, const bool append, log4cxx::helpers::Pool &pool)=0
 
- Public Member Functions inherited from log4cxx::spi::OptionHandler
virtual ~OptionHandler ()
 
void activateOptions ()
 
- Public Member Functions inherited from log4cxx::helpers::Object
virtual ~Object ()
 
virtual const helpers::ClassgetClass () const =0
 
virtual bool instanceof (const Class &clazz) const =0
 
virtual const void * cast (const Class &clazz) const =0
 

Protected Member Functions

 RollingPolicyBase (LOG4CXX_PRIVATE_PTR(RollingPolicyBasePrivate) priv)
 
void parseFileNamePattern ()
 Parse file name pattern. More...
 
void formatFileName (const helpers::ObjectPtr &obj, LogString &buf) const
 Format file name. More...
 
log4cxx::pattern::PatternConverterPtr getIntegerPatternConverter () const
 
log4cxx::pattern::PatternConverterPtr getDatePatternConverter () const
 
void formatFileName (const helpers::ObjectPtr &obj, LogString &buf, helpers::Pool &p) const
 

Detailed Description

Implements methods common to most, it not all, rolling policies.

Constructor & Destructor Documentation

◆ RollingPolicyBase() [1/2]

log4cxx::rolling::RollingPolicyBase::RollingPolicyBase ( )

◆ ~RollingPolicyBase()

virtual log4cxx::rolling::RollingPolicyBase::~RollingPolicyBase ( )
virtual

◆ RollingPolicyBase() [2/2]

log4cxx::rolling::RollingPolicyBase::RollingPolicyBase ( LOG4CXX_PRIVATE_PTR(RollingPolicyBasePrivate)  priv)
protected

Member Function Documentation

◆ activateOptions()

void log4cxx::rolling::RollingPolicyBase::activateOptions ( helpers::Pool p)
overridevirtual

Converts the file name pattern to a collection of formaters.

Implements log4cxx::spi::OptionHandler.

Reimplemented in log4cxx::rolling::TimeBasedRollingPolicy.

◆ formatFileName() [1/2]

void log4cxx::rolling::RollingPolicyBase::formatFileName ( const helpers::ObjectPtr &  obj,
LogString buf 
) const
protected

Format file name.

Parameters
objobject to be evaluted in formatting, may not be null.
bufstring buffer to which formatted file name is appended, may not be null.

◆ formatFileName() [2/2]

void log4cxx::rolling::RollingPolicyBase::formatFileName ( const helpers::ObjectPtr &  obj,
LogString buf,
helpers::Pool p 
) const
protected

◆ getCreateIntermediateDirectories()

bool log4cxx::rolling::RollingPolicyBase::getCreateIntermediateDirectories ( ) const

◆ getDatePatternConverter()

log4cxx::pattern::PatternConverterPtr log4cxx::rolling::RollingPolicyBase::getDatePatternConverter ( ) const
protected

◆ getFileNamePattern()

LogString log4cxx::rolling::RollingPolicyBase::getFileNamePattern ( ) const

Get file name pattern.

Returns
file name pattern.

◆ getFormatSpecifiers()

virtual pattern::PatternMap log4cxx::rolling::RollingPolicyBase::getFormatSpecifiers ( ) const
pure virtual

A map from a name to the object implementing the (date or index) formatting.

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

◆ getIntegerPatternConverter()

log4cxx::pattern::PatternConverterPtr log4cxx::rolling::RollingPolicyBase::getIntegerPatternConverter ( ) const
protected

◆ getPatternConverterList()

PatternConverterList log4cxx::rolling::RollingPolicyBase::getPatternConverterList ( ) const

◆ parseFileNamePattern()

void log4cxx::rolling::RollingPolicyBase::parseFileNamePattern ( )
protected

Parse file name pattern.

◆ setCreateIntermediateDirectories()

void log4cxx::rolling::RollingPolicyBase::setCreateIntermediateDirectories ( bool  createIntermediate)

◆ setFileNamePattern()

void log4cxx::rolling::RollingPolicyBase::setFileNamePattern ( const LogString fnp)

Set file name pattern.

Parameters
fnpfile name pattern.

◆ setOption()

void log4cxx::rolling::RollingPolicyBase::setOption ( const LogString option,
const LogString value 
)
overridevirtual

Set option to value.

Supported options Supported values Default value
FileNamePattern (^) -
CreateIntermediateDirectories True,False False

(^) Legal file name characters plus any conversion specifier supported by the concrete class.

See also
getFormatSpecifiers()

Implements log4cxx::spi::OptionHandler.

Reimplemented in log4cxx::rolling::TimeBasedRollingPolicy.


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