LOG4SHIB::ROLLINGFILEAPPENDER(3)

πŸ“¦ version 2.0.1, in opensuse-leap 16.0

πŸ’… 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 around
  • virtual unsigned int getMaxBackupIndex () const β€” read back that backup count
  • virtual void setMaximumFileSize (size_t maxFileSize) β€” set the size limit that triggers the roll
  • virtual size_t getMaxFileSize () const β€” read back that size limit
  • virtual 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 a FileAppender.
  • FileAppender (const std::string &name, int fd) β€” constructs a FileAppender to 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 name
  • virtual ~LayoutAppender () β€” destructor
  • virtual bool requiresLayout () const β€” check if the appender requires a layout.
  • virtual void setLayout (Layout *layout=NULL) β€” set the Layout for this appender. yes, NULL is the default, it's right there πŸ‘€

⭐ Public Member Functions inherited from log4shib::AppenderSkeleton

  • virtual ~AppenderSkeleton () β€” destructor for AppenderSkeleton.
  • virtual void doAppend (const LoggingEvent &event) β€” log in an Appender-specific way.
  • virtual void setThreshold (Priority::Value priority) β€” set the threshold priority of this Appender.
  • virtual Priority::Value getThreshold () β€” get the threshold priority of this Appender.
  • virtual void setFilter (Filter *filter) β€” set a Filter for this appender.
  • virtual Filter * getFilter () β€” get the Filter for this appender.

πŸŽ€ Public Member Functions inherited from log4shib::Appender

  • virtual ~Appender () β€” destructor for Appender.
  • const std::string & getName () const β€” get the name of this appender.

πŸ’œ Protected Member Functions

  • virtual void _append (const LoggingEvent &event) β€” log in an Appender-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 for AppenderSkeleton.

🌸 Protected Member Functions inherited from log4shib::Appender

  • Appender (const std::string &name) β€” constructor for Appender.

πŸ”₯ Protected Attributes

  • unsigned int _maxBackupIndex
  • size_t _maxFileSize

πŸ¦‹ Protected Attributes inherited from log4shib::FileAppender

  • const std::string _fileName
  • int _fd
  • int _flags
  • mode_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 existing Appender.
  • static bool reopenAll () β€” call reopen() on all existing Appenders.
  • static void closeAll () β€” call reopen() on all existing Appenders. no fr, the docs literally say reopen() here and not close(). 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 β€” The LoggingEvent to 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 πŸŽ€πŸ«Άβœ¨