log4cpp::R...leAppender(3)

πŸ“¦
version 1.1.4 Β· 3 versions
, in opensuse-leap 16.0

🌸 log4cpp::RollingFileAppender 🌸

okay so bestie, this is from the Library Functions Manual for log4cpp, and it's literally the manual page for RollingFileAppender. it's a FileAppender that rolls over the logfile once it hits a size limit β€” iconic behavior for keeping your logs from becoming a whole mess πŸ’…


✨ NAME ✨

log4cpp::RollingFileAppender β€” okay so it's a FileAppender that rolls over the logfile once it's reached a certain size limit. literally that's the whole vibe.


πŸŽ€ SYNOPSIS πŸŽ€

#include <RollingFileAppender.hh>

it inherits from log4cpp::FileAppender. slay.

πŸ’– 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)
  • virtual void setMaxBackupIndex (unsigned int maxBackups)
  • virtual unsigned int getMaxBackupIndex () const
  • virtual void setMaximumFileSize (size_t maxFileSize)
  • virtual size_t getMaxFileSize () const
  • virtual void rollOver ()

🌈 Public Member Functions inherited from log4cpp::FileAppender

  • FileAppender (const std::string &name, const std::string &fileName, bool append=true, mode_t mode=00644) β€” Constructs a FileAppender. periodt.
  • FileAppender (const std::string &name, int fd) β€” Constructs a FileAppender to an already open file descriptor. iykyk.
  • virtual ~FileAppender ()
  • 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 log4cpp::LayoutAppender

  • LayoutAppender (const std::string &name)
  • virtual ~LayoutAppender ()
  • virtual bool requiresLayout () const β€” Check if the appender requires a layout.
  • virtual void setLayout (Layout *layout=NULL) β€” Set the Layout for this appender.

🧚 Public Member Functions inherited from log4cpp::AppenderSkeleton

  • virtual ~AppenderSkeleton () β€” Destructor for AppenderSkeleton.
  • virtual void doAppend (const LoggingEvent &event) β€” Log in 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 log4cpp::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 Appender specific way.

🌸 Protected Member Functions inherited from log4cpp::LayoutAppender

  • Layout & _getLayout () β€” Return the layout of the appender.

🌺 Protected Member Functions inherited from log4cpp::AppenderSkeleton

  • AppenderSkeleton (const std::string &name) β€” Constructor for AppenderSkeleton.

🌷 Protected Member Functions inherited from log4cpp::Appender

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

πŸŽ€ Protected Attributes πŸŽ€

  • unsigned int _maxBackupIndex
  • unsigned short int _maxBackupIndexWidth
  • size_t _maxFileSize

🌼 Protected Attributes inherited from log4cpp::FileAppender

  • const std::string _fileName
  • int _fd
  • int _flags
  • mode_t _mode

🫢 Additional Inherited Members 🫢

πŸ’« Public Types inherited from log4cpp::LayoutAppender

  • typedef BasicLayout DefaultLayoutType

⭐ Static Public Member Functions inherited from log4cpp::Appender

  • static Appender * getAppender (const std::string &name) β€” Get a pointer to an exitsing Appender. (yes, "exitsing" β€” that's exactly what the original says, bestie, not me 😭)
  • static bool reopenAll () β€” Call reopen() on all existing Appenders.
  • static void closeAll () β€” Call reopen() on all existing Appenders.

πŸ’… Detailed Description πŸ’…

RollingFileAppender is a FileAppender that rolls over the logfile once it has reached a certain size limit.

Since: 0.3.1 β€” it's been iconic since day one, no cap.


πŸ”₯ Constructor & Destructor Documentation πŸ”₯

log4cpp::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 main character constructor right there. defaults are literally all laid out for you: maxFileSize = 10*1024*1024, maxBackupIndex = 1, append = true, mode = 00644.


✨ Member Function Documentation ✨

void log4cpp::RollingFileAppender::_append (const LoggingEvent & event)

[protected], [virtual] β€” Log in Appender specific way. Subclasses of Appender should implement this method to perform actual logging.

Parameters:

  • event β€” The LoggingEvent to log.

Reimplemented from log4cpp::FileAppender.

unsigned int log4cpp::RollingFileAppender::getMaxBackupIndex () const

[virtual] β€” gets the max backup index, periodt.

size_t log4cpp::RollingFileAppender::getMaxFileSize () const

[virtual] β€” gets the max file size, obviously πŸ’β€β™€οΈ

void log4cpp::RollingFileAppender::rollOver ()

[virtual] β€” the rollover moment. it's giving main character energy.

void log4cpp::RollingFileAppender::setMaxBackupIndex (unsigned int maxBackups)

[virtual] β€” sets the max backup index.

void log4cpp::RollingFileAppender::setMaximumFileSize (size_t maxFileSize)

[virtual] β€” sets the maximum file size.


🌈 Member Data Documentation 🌈

  • unsigned int log4cpp::RollingFileAppender::_maxBackupIndex [protected]
  • unsigned short int log4cpp::RollingFileAppender::_maxBackupIndexWidth [protected]
  • size_t log4cpp::RollingFileAppender::_maxFileSize [protected]

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for log4cpp from the source code. (so not a human author, bestie β€” it's the Doxygen machine doing its thing 🫢)


and that's the whole page, fr fr. this manual page is Version 1.1 of log4cpp, dated in the footer β€” so when you see that footer line at the bottom, just know it's the source/version/date sign-off. slay, you made it to the end, ily πŸ’–βœ¨

πŸ“¦ where this page comes from