log4shib 2.0.0

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 _LOG4SHIB_ROLLINGFILEAPPENDER_HH
8#define _LOG4SHIB_ROLLINGFILEAPPENDER_HH
9
10#include <log4shib/Portability.hh>
11#include <log4shib/FileAppender.hh>
12#include <string>
13#include <stdarg.h>
14
15 namespace log4shib {
16
22 class LOG4SHIB_EXPORT RollingFileAppender : public FileAppender {
23 public:
24 RollingFileAppender(const std::string& name,
25 const std::string& fileName,
26 size_t maxFileSize = 10*1024*1024,
27 unsigned int maxBackupIndex = 1,
28 bool append = true,
29 mode_t mode = 00644);
30
31 virtual void setMaxBackupIndex(unsigned int maxBackups);
32 virtual unsigned int getMaxBackupIndex() const;
33 virtual void setMaximumFileSize(size_t maxFileSize);
34 virtual size_t getMaxFileSize() const;
35
36 virtual void rollOver();
37
38 protected:
39 virtual void _append(const LoggingEvent& event);
40
41 unsigned int _maxBackupIndex;
42 size_t _maxFileSize;
43 };
44}
45
46#endif // _LOG4SHIB_ROLLINGFILEAPPENDER_HH
LOG4SHIB_EXPORT
#define LOG4SHIB_EXPORT
Definition: Export.hh:11
FileAppender.hh
Portability.hh
log4shib::FileAppender
Definition: FileAppender.hh:20
log4shib::RollingFileAppender
RollingFileAppender is a FileAppender that rolls over the logfile once it has reached a certain size ...
Definition: RollingFileAppender.hh:22
log4shib::RollingFileAppender::_maxBackupIndex
unsigned int _maxBackupIndex
Definition: RollingFileAppender.hh:41
log4shib::RollingFileAppender::_maxFileSize
size_t _maxFileSize
Definition: RollingFileAppender.hh:42
log4shib
The top level namespace for all 'Log for C++' types and classes.
Definition: AbortAppender.hh:16
log4shib::LoggingEvent
The internal representation of logging events.
Definition: LoggingEvent.hh:32