log4cpp 1.1.6
Loading...
Searching...
No Matches
DailyRollingFileAppender.hh
Go to the documentation of this file.
1/*
2 * DailyRollingFileAppender.hh
3 *
4 * Copyright 2015, Alexander Perepelkin. All rights reserved.
5 *
6 * See the COPYING file for the terms of usage and distribution.
7 */
8
9#ifndef _LOG4CPP_DAILYROLLINGFILEAPPENDER_HH
10#define _LOG4CPP_DAILYROLLINGFILEAPPENDER_HH
11
12#include <ctime>
15#include <stdarg.h>
16#include <string>
17
18namespace log4cpp {
19
26 public:
27 DailyRollingFileAppender(const std::string& name, const std::string& fileName,
28 unsigned int maxDaysToKeep = maxDaysToKeepDefault, bool append = true,
29 mode_t mode = 00644);
30
31 virtual void setMaxDaysToKeep(unsigned int maxDaysToKeep);
32 virtual unsigned int getMaxDaysToKeep() const;
33
34 virtual void rollOver();
35
36 static unsigned int maxDaysToKeepDefault;
37
38 protected:
39 virtual void _append(const LoggingEvent& event);
40
41 unsigned int _maxDaysToKeep;
45 struct tm _logsTime;
46 };
47} // namespace log4cpp
48
49#endif // _LOG4CPP_DAILYROLLINGFILEAPPENDER_HH
#define LOG4CPP_EXPORT
Definition Export.hh:26
static unsigned int maxDaysToKeepDefault
Definition DailyRollingFileAppender.hh:36
DailyRollingFileAppender(const std::string &name, const std::string &fileName, unsigned int maxDaysToKeep=maxDaysToKeepDefault, bool append=true, mode_t mode=00644)
Definition DailyRollingFileAppender.cpp:42
virtual void rollOver()
Definition DailyRollingFileAppender.cpp:72
struct tm _logsTime
last log's file creation time (or last modification if appender just created)
Definition DailyRollingFileAppender.hh:45
virtual void _append(const LoggingEvent &event)
Log in Appender specific way.
Definition DailyRollingFileAppender.cpp:150
unsigned int _maxDaysToKeep
Definition DailyRollingFileAppender.hh:41
virtual unsigned int getMaxDaysToKeep() const
Definition DailyRollingFileAppender.cpp:68
virtual void setMaxDaysToKeep(unsigned int maxDaysToKeep)
Definition DailyRollingFileAppender.cpp:64
FileAppender(const std::string &name, const std::string &fileName, bool append=true, mode_t mode=00644)
Constructs a FileAppender.
Definition FileAppender.cpp:27
The top level namespace for all 'Log for C++' types and classes.
Definition AbortAppender.hh:16
The internal representation of logging events.
Definition LoggingEvent.hh:32