log4cplus  2.0.0
Public Member Functions | Protected Member Functions | Protected Attributes
log4cplus::DailyRollingFileAppender Class Reference

DailyRollingFileAppender extends FileAppender so that the underlying file is rolled over at a user chosen frequency. More...

#include <fileappender.h>

Inheritance diagram for log4cplus::DailyRollingFileAppender:
[legend]
Collaboration diagram for log4cplus::DailyRollingFileAppender:
[legend]

List of all members.

Public Member Functions

 DailyRollingFileAppender (const log4cplus::tstring &filename, DailyRollingFileSchedule schedule=DAILY, bool immediateFlush=true, int maxBackupIndex=10, bool createDirs=false)
 DailyRollingFileAppender (const log4cplus::helpers::Properties &properties)
virtual ~DailyRollingFileAppender ()
virtual void close ()
 Release any resources allocated within the appender such as file handles, network connections, etc.

Protected Member Functions

virtual void append (const spi::InternalLoggingEvent &event)
 Subclasses of Appender should implement this method to perform actual logging.
void rollover (bool alreadyLocked=false)
log4cplus::helpers::Time calculateNextRolloverTime (const log4cplus::helpers::Time &t) const
log4cplus::tstring getFilename (const log4cplus::helpers::Time &t) const

Protected Attributes

DailyRollingFileSchedule schedule
log4cplus::tstring scheduledFilename
log4cplus::helpers::Time nextRolloverTime
int maxBackupIndex

Detailed Description

DailyRollingFileAppender extends FileAppender so that the underlying file is rolled over at a user chosen frequency.

Properties

Properties additional to FileAppender's properties:

Schedule

This property specifies rollover schedule. The possible values are MONTHLY, WEEKLY, DAILY, TWICE_DAILY, HOURLY and MINUTELY.

MaxBackupIndex

This property limits how many backup files are kept per single logging period; e.g. how many log.2009-11-07.1, log.2009-11-07.2 etc. files are kept.

Definition at line 267 of file fileappender.h.


Constructor & Destructor Documentation

log4cplus::DailyRollingFileAppender::DailyRollingFileAppender ( const log4cplus::tstring filename,
DailyRollingFileSchedule  schedule = DAILY,
bool  immediateFlush = true,
int  maxBackupIndex = 10,
bool  createDirs = false 
)

Member Function Documentation

virtual void log4cplus::DailyRollingFileAppender::append ( const spi::InternalLoggingEvent event) [protected, virtual]

Subclasses of Appender should implement this method to perform actual logging.

See also:
doAppend method.

Reimplemented from log4cplus::FileAppender.

virtual void log4cplus::DailyRollingFileAppender::close ( ) [virtual]

Release any resources allocated within the appender such as file handles, network connections, etc.

It is a programming error to append to a closed appender.

Reimplemented from log4cplus::FileAppender.

void log4cplus::DailyRollingFileAppender::rollover ( bool  alreadyLocked = false) [protected]

Member Data Documentation

Definition at line 293 of file fileappender.h.

Definition at line 292 of file fileappender.h.

Definition at line 290 of file fileappender.h.

Definition at line 291 of file fileappender.h.


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