log4cplus_DailyRollingFileAppender(3)

log4cplus::DailyRollingFileAppender(3) log4cplus log4cplus::DailyRollingFileAppender(3)

NAME

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

SYNOPSIS

#include <fileappender.h>

Inherits log4cplus::FileAppender.

Public Member Functions


DailyRollingFileAppender (const log4cplus::tstring &filename, DailyRollingFileSchedule schedule=DAILY, bool immediateFlush=true, int maxBackupIndex=10, bool createDirs=false, bool rollOnClose=true, const log4cplus::tstring &datePattern=log4cplus::tstring())
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
bool rollOnClose
log4cplus::tstring datePattern

Additional Inherited Members

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.
RollOnClose
This property specifies whether to rollover log files upon shutdown. By default it's set to true to retain compatibility with legacy code, however it may lead to undesired behaviour as described in the github issue #120.
DatePattern
This property specifies filename suffix pattern to use for periodical backups of the logfile. The patern should be in format supported by log4cplus::helpers::Time::getFormatterTime(). Please notice that the format of the pattern is similar but not identical to the one used for this option in the corresponding Log4J class. If the property isn't specified a reasonable default for a given schedule type is used.

Definition at line 311 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, bool rollOnClose = true, const log4cplus::tstring & datePattern = log4cplus::tstring())

log4cplus::DailyRollingFileAppender::DailyRollingFileAppender (const log4cplus::helpers::Properties & properties)

virtual log4cplus::DailyRollingFileAppender::~DailyRollingFileAppender () [virtual]

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::FileAppenderBase.

log4cplus::helpers::Time log4cplus::DailyRollingFileAppender::calculateNextRolloverTime (const log4cplus::helpers::Time & t) const [protected]

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::FileAppenderBase.

log4cplus::tstring log4cplus::DailyRollingFileAppender::getFilename (const log4cplus::helpers::Time & t) const [protected]

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

Member Data Documentation

log4cplus::tstring log4cplus::DailyRollingFileAppender::datePattern [protected]

Definition at line 341 of file fileappender.h.

int log4cplus::DailyRollingFileAppender::maxBackupIndex [protected]

Definition at line 339 of file fileappender.h.

log4cplus::helpers::Time log4cplus::DailyRollingFileAppender::nextRolloverTime [protected]

Definition at line 338 of file fileappender.h.

bool log4cplus::DailyRollingFileAppender::rollOnClose [protected]

Definition at line 340 of file fileappender.h.

DailyRollingFileSchedule log4cplus::DailyRollingFileAppender::schedule [protected]

Definition at line 336 of file fileappender.h.

log4cplus::tstring log4cplus::DailyRollingFileAppender::scheduledFilename [protected]

Definition at line 337 of file fileappender.h.

Author

Generated automatically by Doxygen for log4cplus from the source code.

Fri Jun 18 2021 Version 2.0.6