Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

RollingFileAppender.hh

Go to the documentation of this file.
00001 /*
00002  * RollingFileAppender.hh
00003  *
00004  * See the COPYING file for the terms of usage and distribution.
00005  */
00006 
00007 #ifndef _LOG4CPP_ROLLINGFILEAPPENDER_HH
00008 #define _LOG4CPP_ROLLINGFILEAPPENDER_HH
00009 
00010 #include <log4cpp/Portability.hh>
00011 #include <log4cpp/FileAppender.hh>
00012 #include <string>
00013 #include <stdarg.h>
00014 
00015 namespace log4cpp {
00016 
00022     class LOG4CPP_EXPORT RollingFileAppender : public FileAppender {
00023         public:
00024         RollingFileAppender(const std::string& name, 
00025                             const std::string& fileName,
00026                             size_t maxFileSize = 10*1024*1024, 
00027                             unsigned int maxBackupIndex = 1,
00028                             bool append = true,
00029                             mode_t mode = 00644);
00030 
00031         virtual void setMaxBackupIndex(unsigned int maxBackups);
00032         virtual unsigned int getMaxBackupIndex() const;
00033         virtual void setMaximumFileSize(size_t maxFileSize);
00034         virtual size_t getMaxFileSize() const;
00035 
00036         virtual void rollOver();
00037 
00038         protected:
00039         virtual void _append(const LoggingEvent& event);
00040 
00041         unsigned int _maxBackupIndex;
00042         size_t _maxFileSize;
00043     };
00044 }
00045 
00046 #endif // _LOG4CPP_ROLLINGFILEAPPENDER_HH

Generated on Mon Oct 28 23:41:43 2002 for log4cpp by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002