Log4Qt::DailyRollingFileAppender Class Reference

The class DailyRollingFileAppender extends FileAppender so that the underlying file is rolled over at a specified frequency. More...

#include <dailyrollingfileappender.h>

Inheritance diagram for Log4Qt::DailyRollingFileAppender:

Log4Qt::FileAppender Log4Qt::WriterAppender Log4Qt::AppenderSkeleton Log4Qt::Appender Log4Qt::LogObject

List of all members.

Public Types

enum  DatePattern {
  MINUTELY_ROLLOVER = 0, HOURLY_ROLLOVER, HALFDAILY_ROLLOVER, DAILY_ROLLOVER,
  WEEKLY_ROLLOVER, MONTHLY_ROLLOVER
}

Public Member Functions

 DailyRollingFileAppender (QObject *pParent=0)
 DailyRollingFileAppender (Layout *pLayout, const QString &rFileName, const QString &rDatePattern, QObject *pParent=0)
virtual ~DailyRollingFileAppender ()
QString datePattern () const
void setDatePattern (DatePattern datePattern)
void setDatePattern (const QString &rDatePattern)
virtual void activateOptions ()

Protected Member Functions

virtual void append (const LoggingEvent &rEvent)
virtual bool checkEntryConditions () const
virtual QDebug debug (QDebug &rDebug) const

Properties

QString datePattern


Detailed Description

The class DailyRollingFileAppender extends FileAppender so that the underlying file is rolled over at a specified frequency.

Note:
All the functions declared in this class are thread-safe.

The ownership and lifetime of objects of this class are managed. See Object ownership for more details.


Member Enumeration Documentation

The enum DatePattern defines constants for date patterns.

See also:
setDatePattern(DatePattern)
Enumerator:
MINUTELY_ROLLOVER  The minutely date pattern string is "'.'yyyy-MM-dd-hh-mm".
HOURLY_ROLLOVER  The hourly date pattern string is "'.'yyyy-MM-dd-hh".
HALFDAILY_ROLLOVER  The half-daily date pattern string is "'.'yyyy-MM-dd-a".
DAILY_ROLLOVER  The daily date pattern string is "'.'yyyy-MM-dd".
WEEKLY_ROLLOVER  The weekly date pattern string is "'.'yyyy-ww".
MONTHLY_ROLLOVER  The monthly date pattern string is "'.'yyyy-MM".


Constructor & Destructor Documentation

Log4Qt::DailyRollingFileAppender::DailyRollingFileAppender ( QObject *  pParent = 0  ) 

Log4Qt::DailyRollingFileAppender::DailyRollingFileAppender ( Layout pLayout,
const QString &  rFileName,
const QString &  rDatePattern,
QObject *  pParent = 0 
)

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


Member Function Documentation

QString Log4Qt::DailyRollingFileAppender::datePattern (  )  const

void Log4Qt::DailyRollingFileAppender::setDatePattern ( DatePattern  datePattern  ) 

Sets the datePattern to the value specified by the datePattern constant.

void Log4Qt::DailyRollingFileAppender::setDatePattern ( const QString &  rDatePattern  )  [inline]

virtual void Log4Qt::DailyRollingFileAppender::activateOptions (  )  [virtual]

Reimplemented from Log4Qt::FileAppender.

virtual void Log4Qt::DailyRollingFileAppender::append ( const LoggingEvent rEvent  )  [protected, virtual]

Reimplemented from Log4Qt::WriterAppender.

virtual bool Log4Qt::DailyRollingFileAppender::checkEntryConditions (  )  const [protected, virtual]

Tests if all entry conditions for using append() in this class are met.

If a conditions is not met, an error is logged and the function returns false. Otherwise the result of FileAppender::checkEntryConditions() is returned.

The checked conditions are:

  • A valid pattern has been set (APPENDER_USE_INVALID_PATTERN_ERROR)

The function is called as part of the checkEntryConditions() chain started by AppenderSkeleton::doAppend().

See also:
AppenderSkeleton::doAppend(), AppenderSkeleton::checkEntryConditions()

Reimplemented from Log4Qt::FileAppender.

virtual QDebug Log4Qt::DailyRollingFileAppender::debug ( QDebug &  rDebug  )  const [protected, virtual]

Writes all object member variables to the given debug stream rDebug and returns the stream.

DailyRollingFileAppender(name:"DRFA" activedatepattern:"'.'yyyy-MM-dd-hh-mm" appendfile:false bufferedio:true datepattern:"'.'yyyy-MM-dd-hh-mm" encoding:"" frequency:"MINUTELY_ROLLOVER" file:"/log.txt" filter:0x0 immediateflush:true isactive:true isclosed:false layout:"TTCC" referencecount:1 rollovertime:QDateTime("Mon Oct 22 05:23:00 2007") threshold: "NULL" writer: 0x0 )

See also:
QDebug, operator<<(QDebug debug, const LogObject &rLogObject)

Reimplemented from Log4Qt::FileAppender.


Property Documentation

QString Log4Qt::DailyRollingFileAppender::datePattern [inline, read, write]

The property holds the date pattern used by the appender.

The default is DAILY_ROLLOVER for rollover at midnight each day.

See also:
datePattern(), setDatePattern()


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

Generated on Sun Mar 1 16:40:45 2009 for Log4Qt by  doxygen 1.5.6