LOG4SHIB::ROLLINGFILEAPPENDER(3)
π NAME
okay so bestie, welcome to log4shib::RollingFileAppender β it's a FileAppender that rolls over the logfile once it has reached a certain size limit. that's the whole vibe. it's giving "your log file but make it not 47 gigabytes". π
(this whole page lives in the log4shib manual, section 3 β library functions, for the record π«Ά)
β¨ SYNOPSIS
#include <RollingFileAppender.hh>
Inherits log4shib::FileAppender. yes queen, it's a whole family tree. π³
πΈ Public Member Functions
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)β the constructor, all six args, defaults included, no cap β¨virtual void setMaxBackupIndex (unsigned int maxBackups)β set how many backups you're keeping aroundvirtual unsigned int getMaxBackupIndex () constβ read back that backup countvirtual void setMaximumFileSize (size_t maxFileSize)β set the size limit that triggers the rollvirtual size_t getMaxFileSize () constβ read back that size limitvirtual void rollOver ()β do the actual rollover, iconic behavior π«
π¦ Public Member Functions inherited from log4shib::FileAppender
FileAppender (const std::string &name, const std::string &fileName, bool append=true, mode_t mode=00644)β constructs aFileAppender.FileAppender (const std::string &name, int fd)β constructs aFileAppenderto an already open file descriptor.virtual ~FileAppender ()β destructor, bye bestie πvirtual bool reopen ()β reopens the logfile.virtual void close ()β closes the logfile.virtual void setAppend (bool append)β sets the append vs truncate flag.virtual bool getAppend () constβ gets the value of the'append'option.virtual void setMode (mode_t mode)β sets the file open mode.virtual mode_t getMode () constβ gets the file open mode.
π Public Member Functions inherited from log4shib::LayoutAppender
LayoutAppender (const std::string &name)β constructor, takes a namevirtual ~LayoutAppender ()β destructorvirtual bool requiresLayout () constβ check if the appender requires a layout.virtual void setLayout (Layout *layout=NULL)β set theLayoutfor this appender. yes,NULLis the default, it's right there π
β Public Member Functions inherited from log4shib::AppenderSkeleton
virtual ~AppenderSkeleton ()β destructor forAppenderSkeleton.virtual void doAppend (const LoggingEvent &event)β log in anAppender-specific way.virtual void setThreshold (Priority::Value priority)β set the threshold priority of thisAppender.virtual Priority::Value getThreshold ()β get the threshold priority of thisAppender.virtual void setFilter (Filter *filter)β set aFilterfor this appender.virtual Filter * getFilter ()β get theFilterfor this appender.
π Public Member Functions inherited from log4shib::Appender
virtual ~Appender ()β destructor forAppender.const std::string & getName () constβ get the name of this appender.
π Protected Member Functions
virtual void _append (const LoggingEvent &event)β log in anAppender-specific way. it's the protected one, the backstage pass ποΈ
π§ Protected Member Functions inherited from log4shib::LayoutAppender
Layout & _getLayout ()β return the layout of the appender.
π Protected Member Functions inherited from log4shib::AppenderSkeleton
AppenderSkeleton (const std::string &name)β constructor forAppenderSkeleton.
πΈ Protected Member Functions inherited from log4shib::Appender
Appender (const std::string &name)β constructor forAppender.
π₯ Protected Attributes
unsigned int _maxBackupIndexsize_t _maxFileSize
π¦ Protected Attributes inherited from log4shib::FileAppender
const std::string _fileNameint _fdint _flagsmode_t _mode
π Additional Inherited Members
Public Types inherited from log4shib::LayoutAppender:
typedef BasicLayout DefaultLayoutType
Static Public Member Functions inherited from log4shib::Appender:
static Appender * getAppender (const std::string &name)β get a pointer to an existingAppender.static bool reopenAll ()β callreopen()on all existingAppenders.static void closeAll ()β callreopen()on all existingAppenders. no fr, the docs literally sayreopen()here and notclose(). i'm just the messenger ππ
π Detailed Description
RollingFileAppender is a FileAppender that rolls over the logfile once it has reached a certain size limit. literally the same sentence as NAME because that's the entire personality, and honestly? respect. π«‘
Since β 0.3.1 (an elder, a legend, a founding mother π)
π Constructor & Destructor Documentation
πΈ log4shib::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)
that's the constructor, bestie. all the defaults are right there in the signature β 10*1024*1024 bytes max, 1 backup, append = true, mode 00644 β copy them exactly, don't get creative with my girl's numbers π
π¦ Member Function Documentation
π« void log4shib::RollingFileAppender::_append (const LoggingEvent & event)
[protected], [virtual]
Log in an Appender-specific way. Subclasses of Appender should implement this method to perform actual logging.
Parameters
eventβ TheLoggingEventto log.
Reimplemented from log4shib::FileAppender.
π« unsigned int log4shib::RollingFileAppender::getMaxBackupIndex () const
[virtual]
π« size_t log4shib::RollingFileAppender::getMaxFileSize () const
[virtual]
π« void log4shib::RollingFileAppender::rollOver ()
[virtual]
π« void log4shib::RollingFileAppender::setMaxBackupIndex (unsigned int maxBackups)
[virtual]
π« void log4shib::RollingFileAppender::setMaximumFileSize (size_t maxFileSize)
[virtual]
these five are listed with no description in the original β so no, i'm not gonna invent lore for them. they're mysterious. they're main character energy. they simply are. πβ¨
π Member Data Documentation
β unsigned int log4shib::RollingFileAppender::_maxBackupIndex
[protected]
β size_t log4shib::RollingFileAppender::_maxFileSize
[protected]
π Author
Generated automatically by Doxygen for log4shib from the source code. (so if the grammar is weird, blame the robot, not me π€π
)
okay that's the whole page, and before you go: this is log4shib Version 2.0.1, manual page log4shib::...ileAppender(3) β the truncated title is not a typo, that's genuinely how it renders, and yes it's a little cursed π. mwah, go roll some files responsibly ππ«Άβ¨
π¦ where this page comes from
- opensuse-leap 16.0: liblog4shib-devel 2.0.1-160000.3.2 Β· LGPL-2.1-only
- opensuse-leap 16.0: liblog4shib-devel 2.0.1-160000.3.2 Β· LGPL-2.1-only
- opensuse-leap 16.0: liblog4shib-devel 2.0.1-160000.3.2 Β· LGPL-2.1-only
- opensuse-leap 16.0: liblog4shib-devel 2.0.1-160000.3.2 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms