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);
Extend this class for implementing your own strategies for printing log statements.
DailyRollingFileAppender extends FileAppender so that the underlying file is rolled over at a user ch...
virtual ~DailyRollingFileAppender()
void rollover(bool alreadyLocked=false)
DailyRollingFileAppender(const log4cplus::helpers::Properties &properties)
virtual void close()
Release any resources allocated within the appender such as file handles, network connections,...
log4cplus::tstring getFilename(const log4cplus::helpers::Time &t) const
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())
log4cplus::tstring datePattern
virtual void append(const spi::InternalLoggingEvent &event)
Subclasses of Appender should implement this method to perform actual logging.
log4cplus::helpers::Time calculateNextRolloverTime(const log4cplus::helpers::Time &t) const
DailyRollingFileSchedule schedule
log4cplus::helpers::Time nextRolloverTime
log4cplus::tstring scheduledFilename
Base class for Appenders writing log events to a file.
virtual void append(const spi::InternalLoggingEvent &event)
Subclasses of Appender should implement this method to perform actual logging.
log4cplus::helpers::Time reopen_time
bool immediateFlush
Immediate flush means that the underlying writer or output stream will be flushed at the end of each ...
log4cplus::tstring lockFileName
bool createDirs
When this variable is true, FileAppender will try to create missing directories in path leading to lo...
virtual std::locale imbue(std::locale const &loc)
Redefine default locale for output stream.
std::ios_base::openmode fileOpenMode
log4cplus::tstring filename
virtual void open(std::ios_base::openmode mode)
int reopenDelay
When any append operation fails, reopenDelay says for how many seconds the next attempt to re-open th...
log4cplus::tstring localeName
FileAppenderBase(const log4cplus::helpers::Properties &properties, std::ios_base::openmode mode=std::ios_base::trunc)
virtual void close()
Release any resources allocated within the appender such as file handles, network connections,...
std::unique_ptr< log4cplus::tchar[]> buffer
FileAppenderBase(const log4cplus::tstring &filename, std::ios_base::openmode mode=std::ios_base::trunc, bool immediateFlush=true, bool createDirs=false)
virtual std::locale getloc() const
Appends log events to a file.
FileAppender(const log4cplus::tstring &filename, std::ios_base::openmode mode=std::ios_base::trunc, bool immediateFlush=true, bool createDirs=false)
FileAppender(const log4cplus::helpers::Properties &properties, std::ios_base::openmode mode=std::ios_base::trunc)
RollingFileAppender extends FileAppender to backup the log files when they reach a certain size.
RollingFileAppender(const log4cplus::helpers::Properties &properties)
void rollover(bool alreadyLocked=false)
RollingFileAppender(const log4cplus::tstring &filename, long maxFileSize=10 *1024 *1024, int maxBackupIndex=1, bool immediateFlush=true, bool createDirs=false)
virtual void append(const spi::InternalLoggingEvent &event)
Subclasses of Appender should implement this method to perform actual logging.
virtual ~RollingFileAppender()
TimeBasedRollingFileAppender extends FileAppenderBase so that the underlying file is rolled over at a...
TimeBasedRollingFileAppender(const helpers::Properties &properties)
log4cplus::helpers::Time lastHeartBeat
void close()
Release any resources allocated within the appender such as file handles, network connections,...
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)
void append(const spi::InternalLoggingEvent &event)
Subclasses of Appender should implement this method to perform actual logging.
log4cplus::helpers::Time nextRolloverTime
tstring scheduledFilename
DailyRollingFileSchedule schedule
void open(std::ios_base::openmode mode)
~TimeBasedRollingFileAppender()
void clean(helpers::Time time)
helpers::Time calculateNextRolloverTime(const helpers::Time &t) const
void rollover(bool alreadyLocked=false)
helpers::Time::duration getRolloverPeriodDuration() const
The internal representation of logging events.
#define LOG4CPLUS_TEXT(STRING)
#define LOG4CPLUS_PRIVATE
chrono::time_point< Clock, Duration > Time
helpers::SharedObjectPtr< RollingFileAppender > SharedRollingFileAppenderPtr
helpers::SharedObjectPtr< DailyRollingFileAppender > SharedDailyRollingFileAppenderPtr
std::basic_ofstream< tchar > tofstream
helpers::SharedObjectPtr< TimeBasedRollingFileAppender > SharedTimeBasedRollingFileAppenderPtr
std::basic_string< tchar > tstring
helpers::SharedObjectPtr< FileAppender > SharedFileAppenderPtr