 |
log4cplus
2.0.5
|
Go to the documentation of this file.
24 #ifndef LOG4CPLUS_FILE_APPENDER_HEADER_
25 #define LOG4CPLUS_FILE_APPENDER_HEADER_
29 #if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
124 virtual std::locale
imbue(std::locale
const& loc);
132 std::ios_base::openmode mode = std::ios_base::trunc,
133 bool immediateFlush =
true,
134 bool createDirs =
false);
136 std::ios_base::openmode mode = std::ios_base::trunc);
142 virtual void open(std::ios_base::openmode mode);
178 std::unique_ptr<log4cplus::tchar[]>
buffer;
205 std::ios_base::openmode mode = std::ios_base::trunc,
206 bool immediateFlush =
true,
207 bool createDirs =
false);
209 std::ios_base::openmode mode = std::ios_base::trunc);
246 long maxFileSize = 10*1024*1024,
247 int maxBackupIndex = 1,
248 bool immediateFlush =
true,
249 bool createDirs =
false);
316 bool immediateFlush =
true,
317 int maxBackupIndex = 10,
318 bool createDirs =
false,
319 bool rollOnClose =
true,
391 bool cleanHistoryOnStart =
false,
392 bool immediateFlush =
true,
393 bool createDirs =
false,
394 bool rollOnClose =
true);
402 void open(std::ios_base::openmode mode);
428 #endif // LOG4CPLUS_FILE_APPENDER_HEADER_
DailyRollingFileAppender(const log4cplus::tstring &filename, DailyRollingFileSchedule schedule=DAILY, bool immediateFlush=true, int maxBackupIndex=10, bool createDirs=false, bool rollOnClose=true, const log4cplus::tstring &datePattern=log4cplus::tstring())
virtual void open(std::ios_base::openmode mode)
helpers::SharedObjectPtr< DailyRollingFileAppender > SharedDailyRollingFileAppenderPtr
helpers::Time calculateNextRolloverTime(const helpers::Time &t) const
Base class for Appenders writing log events to a file.
helpers::SharedObjectPtr< TimeBasedRollingFileAppender > SharedTimeBasedRollingFileAppenderPtr
bool createDirs
When this variable is true, FileAppender will try to create missing directories in path leading to lo...
std::unique_ptr< log4cplus::tchar[]> buffer
std::basic_string< tchar > tstring
void close()
Release any resources allocated within the appender such as file handles, network connections,...
TimeBasedRollingFileAppender extends FileAppenderBase so that the underlying file is rolled over at a...
virtual ~RollingFileAppender()
DailyRollingFileAppender extends FileAppender so that the underlying file is rolled over at a user ch...
RollingFileAppender(const log4cplus::helpers::Properties &properties)
TimeBasedRollingFileAppender(const helpers::Properties &properties)
#define LOG4CPLUS_TEXT(STRING)
log4cplus::tstring lockFileName
tstring scheduledFilename
RollingFileAppender(const log4cplus::tstring &filename, long maxFileSize=10 *1024 *1024, int maxBackupIndex=1, bool immediateFlush=true, bool createDirs=false)
std::ios_base::openmode fileOpenMode
void rollover(bool alreadyLocked=false)
virtual void close()
Release any resources allocated within the appender such as file handles, network connections,...
Appends log events to a file.
void rollover(bool alreadyLocked=false)
FileAppender(const log4cplus::tstring &filename, std::ios_base::openmode mode=std::ios_base::trunc, bool immediateFlush=true, bool createDirs=false)
void rollover(bool alreadyLocked=false)
log4cplus::tstring filename
virtual void append(const spi::InternalLoggingEvent &event)
Subclasses of Appender should implement this method to perform actual logging.
log4cplus::helpers::Time nextRolloverTime
bool immediateFlush
Immediate flush means that the underlying writer or output stream will be flushed at the end of each ...
virtual ~DailyRollingFileAppender()
DailyRollingFileSchedule schedule
FileAppenderBase(const log4cplus::tstring &filename, std::ios_base::openmode mode=std::ios_base::trunc, bool immediateFlush=true, bool createDirs=false)
virtual void append(const spi::InternalLoggingEvent &event)
Subclasses of Appender should implement this method to perform actual logging.
log4cplus::tstring datePattern
log4cplus::helpers::Time lastHeartBeat
log4cplus::tstring localeName
void clean(helpers::Time time)
log4cplus::helpers::Time nextRolloverTime
TimeBasedRollingFileAppender(const tstring &filename=LOG4CPLUS_TEXT(""), const tstring &filenamePattern=LOG4CPLUS_TEXT("%d.log"), int maxHistory=10, bool cleanHistoryOnStart=false, bool immediateFlush=true, bool createDirs=false, bool rollOnClose=true)
The internal representation of logging events.
int reopenDelay
When any append operation fails, reopenDelay says for how many seconds the next attempt to re-open th...
void open(std::ios_base::openmode mode)
log4cplus::helpers::Time reopen_time
log4cplus::tstring scheduledFilename
log4cplus::tstring getFilename(const log4cplus::helpers::Time &t) const
void append(const spi::InternalLoggingEvent &event)
Subclasses of Appender should implement this method to perform actual logging.
helpers::Time::duration getRolloverPeriodDuration() const
virtual std::locale getloc() const
DailyRollingFileSchedule schedule
virtual void close()
Release any resources allocated within the appender such as file handles, network connections,...
virtual void append(const spi::InternalLoggingEvent &event)
Subclasses of Appender should implement this method to perform actual logging.
helpers::SharedObjectPtr< RollingFileAppender > SharedRollingFileAppenderPtr
chrono::time_point< Clock, Duration > Time
std::basic_ofstream< tchar > tofstream
#define LOG4CPLUS_PRIVATE
Extend this class for implementing your own strategies for printing log statements.
RollingFileAppender extends FileAppender to backup the log files when they reach a certain size.
virtual std::locale imbue(std::locale const &loc)
Redefine default locale for output stream.
helpers::SharedObjectPtr< FileAppender > SharedFileAppenderPtr
~TimeBasedRollingFileAppender()
log4cplus::helpers::Time calculateNextRolloverTime(const log4cplus::helpers::Time &t) const
FileAppenderBase(const log4cplus::helpers::Properties &properties, std::ios_base::openmode mode=std::ios_base::trunc)
FileAppender(const log4cplus::helpers::Properties &properties, std::ios_base::openmode mode=std::ios_base::trunc)
DailyRollingFileAppender(const log4cplus::helpers::Properties &properties)