log4cpp  1.1.6
RollingFileAppender.hh
Go to the documentation of this file.
1 /*
2  * RollingFileAppender.hh
3  *
4  * See the COPYING file for the terms of usage and distribution.
5  */
6 
7 #ifndef _LOG4CPP_ROLLINGFILEAPPENDER_HH
8 #define _LOG4CPP_ROLLINGFILEAPPENDER_HH
9 
10 #include <log4cpp/FileAppender.hh>
11 #include <log4cpp/Portability.hh>
12 #include <stdarg.h>
13 #include <string>
14 
15 namespace log4cpp {
16 
23  public:
24  RollingFileAppender(const std::string& name, const std::string& fileName, size_t maxFileSize = 10 * 1024 * 1024,
25  unsigned int maxBackupIndex = 1, bool append = true, mode_t mode = 00644);
26 
27  virtual void setMaxBackupIndex(unsigned int maxBackups);
28  virtual unsigned int getMaxBackupIndex() const;
29  virtual void setMaximumFileSize(size_t maxFileSize);
30  virtual size_t getMaxFileSize() const;
31 
32  virtual void rollOver();
33 
34  protected:
35  virtual void _append(const LoggingEvent& event);
36 
37  unsigned int _maxBackupIndex;
41  unsigned short int _maxBackupIndexWidth;
42 
43  size_t _maxFileSize;
44  };
45 } // namespace log4cpp
46 
47 #endif // _LOG4CPP_ROLLINGFILEAPPENDER_HH
Definition: FileAppender.hh:20
unsigned int _maxBackupIndex
Definition: RollingFileAppender.hh:37
size_t _maxFileSize
Definition: RollingFileAppender.hh:43
#define LOG4CPP_EXPORT
Definition: Export.hh:26
The top level namespace for all &#39;Log for C++&#39; types and classes.
Definition: AbortAppender.hh:16
The internal representation of logging events.
Definition: LoggingEvent.hh:32
unsigned short int _maxBackupIndexWidth
keep constant index width by zeroing leading positions
Definition: RollingFileAppender.hh:41
RollingFileAppender is a FileAppender that rolls over the logfile once it has reached a certain size ...
Definition: RollingFileAppender.hh:22