Public Member Functions | Protected Attributes | List of all members
log4cpp::GenerationalFileAppender Class Reference

#include <GenerationalFileAppender.hh>

Inheritance diagram for log4cpp::GenerationalFileAppender:
Inheritance graph
[legend]

Public Member Functions

virtual void advanceGeneration ()
 
 GenerationalFileAppender (const std::string &name, const std::string &fileName, bool append=true, mode_t mode=00644)
 Open "filename.0" and set _generation=0. More...
 
- Public Member Functions inherited from log4cpp::FileAppender
virtual void close ()
 
 FileAppender (const std::string &name, const std::string &fileName, bool append=true, mode_t mode=00644)
 
 FileAppender (const std::string &name, int fd)
 
virtual bool getAppend () const
 
virtual mode_t getMode () const
 
virtual bool reopen ()
 
virtual void setAppend (bool append)
 
virtual void setMode (mode_t mode)
 
virtual ~FileAppender ()
 
- Public Member Functions inherited from log4cpp::LayoutAppender
 LayoutAppender (const std::string &name)
 
virtual bool requiresLayout () const
 
virtual void setLayout (Layout *layout=NULL)
 
virtual ~LayoutAppender ()
 
- Public Member Functions inherited from log4cpp::AppenderSkeleton
virtual void doAppend (const LoggingEvent &event)
 
virtual FiltergetFilter ()
 
virtual Priority::Value getThreshold ()
 
virtual void setFilter (Filter *filter)
 
virtual void setThreshold (Priority::Value priority)
 
virtual ~AppenderSkeleton ()
 
- Public Member Functions inherited from log4cpp::Appender
const std::string & getName () const
 
virtual ~Appender ()
 

Protected Attributes

unsigned int _generation
 The current generation (initializes to 0) More...
 
std::string _originalFileName
 Filename given to the constructor, before an extension is applied. More...
 
- Protected Attributes inherited from log4cpp::FileAppender
int _fd
 
const std::string _fileName
 
int _flags
 
mode_t _mode
 

Additional Inherited Members

- Public Types inherited from log4cpp::LayoutAppender
typedef BasicLayout DefaultLayoutType
 
- Static Public Member Functions inherited from log4cpp::Appender
static void closeAll ()
 
static AppendergetAppender (const std::string &name)
 
static bool reopenAll ()
 
- Protected Member Functions inherited from log4cpp::FileAppender
virtual void _append (const LoggingEvent &event)
 
- Protected Member Functions inherited from log4cpp::LayoutAppender
Layout_getLayout ()
 
- Protected Member Functions inherited from log4cpp::AppenderSkeleton
 AppenderSkeleton (const std::string &name)
 
- Protected Member Functions inherited from log4cpp::Appender
 Appender (const std::string &name)
 

Detailed Description

A FileAppender that rolls over logfile generations when instructed.

Parameters
namethe name of the Appender.
fileNamethe name of the file to which the Appender has to log (the actual filename will be "filename" for the first logfile, and "filename.0" after rollOver(), then "filename.1", etc.)
appendwhether the Appender has to truncate the file or just append to it if it already exists. Defaults to 'true'.
modefile mode to open the logfile with. Defaults to 00644.
Since
6.0.0

Definition at line 28 of file GenerationalFileAppender.hh.

Constructor & Destructor Documentation

log4cpp::GenerationalFileAppender::GenerationalFileAppender ( const std::string &  name,
const std::string &  fileName,
bool  append = true,
mode_t  mode = 00644 
)

Open "filename.0" and set _generation=0.

Definition at line 30 of file GenerationalFileAppender.cpp.

Member Function Documentation

void log4cpp::GenerationalFileAppender::advanceGeneration ( )
virtual

Advance to next logfile generation

Postcondition
if could open the next file then all subsequent events are logged to the new logfile ("filename._generation"), otherwise all subsequent events continue to be logged to the currently open logfile
Todo:
else produce error on stderr?

Definition at line 39 of file GenerationalFileAppender.cpp.

Member Data Documentation

unsigned int log4cpp::GenerationalFileAppender::_generation
protected

The current generation (initializes to 0)

Definition at line 49 of file GenerationalFileAppender.hh.

std::string log4cpp::GenerationalFileAppender::_originalFileName
protected

Filename given to the constructor, before an extension is applied.

Definition at line 47 of file GenerationalFileAppender.hh.


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


log4cpp
Author(s): Stephen Roderick, Bastiaan Bakker, Cedric Le Goater, Steve Ostlind, Marcel Harkema, Walter Stroebel, Glenn Scott and Tony Cheung
autogenerated on Sun Jun 23 2019 19:10:00