Loading...
Searching...
No Matches
RollingFileAppender.hh
Go to the documentation of this file.
/*
* RollingFileAppender.hh
*
* See the COPYING file for the terms of usage and distribution.
*/
#ifndef _LOG4SHIB_ROLLINGFILEAPPENDER_HH
#define _LOG4SHIB_ROLLINGFILEAPPENDER_HH
#include <log4shib/Portability.hh>
#include <log4shib/FileAppender.hh>
#include <string>
#include <stdarg.h>
namespace log4shib {
class LOG4SHIB_EXPORT RollingFileAppender : public FileAppender {
public:
RollingFileAppender(const std::string& name,
const std::string& fileName,
size_t maxFileSize = 10*1024*1024,
unsigned int maxBackupIndex = 1,
bool append = true,
mode_t mode = 00644);
virtual void setMaxBackupIndex(unsigned int maxBackups);
virtual unsigned int getMaxBackupIndex() const;
virtual void setMaximumFileSize(size_t maxFileSize);
virtual size_t getMaxFileSize() const;
virtual void rollOver();
protected:
virtual void _append(const LoggingEvent& event);
unsigned int _maxBackupIndex;
size_t _maxFileSize;
};
}
#endif // _LOG4SHIB_ROLLINGFILEAPPENDER_HH
LOG4SHIB_EXPORT
#define LOG4SHIB_EXPORT
Definition Export.hh:11
FileAppender.hh
Portability.hh
log4shib::FileAppender::FileAppender
FileAppender(const std::string &name, const std::string &fileName, bool append=true, mode_t mode=00644)
Constructs a FileAppender.
Definition FileAppender.cpp:26
log4shib::RollingFileAppender::rollOver
virtual void rollOver()
Definition RollingFileAppender.cpp:53
log4shib::RollingFileAppender::getMaxBackupIndex
virtual unsigned int getMaxBackupIndex() const
Definition RollingFileAppender.cpp:41
log4shib::RollingFileAppender::_maxBackupIndex
unsigned int _maxBackupIndex
Definition RollingFileAppender.hh:41
log4shib::RollingFileAppender::setMaxBackupIndex
virtual void setMaxBackupIndex(unsigned int maxBackups)
Definition RollingFileAppender.cpp:37
log4shib::RollingFileAppender::getMaxFileSize
virtual size_t getMaxFileSize() const
Definition RollingFileAppender.cpp:49
log4shib::RollingFileAppender::_maxFileSize
size_t _maxFileSize
Definition RollingFileAppender.hh:42
log4shib::RollingFileAppender::setMaximumFileSize
virtual void setMaximumFileSize(size_t maxFileSize)
Definition RollingFileAppender.cpp:45
log4shib::RollingFileAppender::RollingFileAppender
RollingFileAppender(const std::string &name, const std::string &fileName, size_t maxFileSize=10 *1024 *1024, unsigned int maxBackupIndex=1, bool append=true, mode_t mode=00644)
Definition RollingFileAppender.cpp:26
log4shib::RollingFileAppender::_append
virtual void _append(const LoggingEvent &event)
Log in Appender specific way.
Definition RollingFileAppender.cpp:85
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