.TH "log4tango::FileAppender" 3 "Wed Sep 2 2020" "Version 5.0.2" "log4tango" \" -*- nroff -*- .ad l .nh .SH NAME log4tango::FileAppender .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBlog4tango::LayoutAppender\fP\&. .PP Inherited by \fBlog4tango::RollingFileAppender\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBFileAppender\fP (const std::string &name, const std::string &fileName, bool \fBappend\fP=true, mode_t mode=00644)" .br .RI "Constructs a \fBFileAppender\fP\&. " .ti -1c .RI "\fBFileAppender\fP (const std::string &name, int fd)" .br .RI "Constructs a \fBFileAppender\fP to an already open file descriptor\&. " .ti -1c .RI "virtual \fB~FileAppender\fP ()" .br .RI "Destructor\&. " .ti -1c .RI "virtual bool \fBreopen\fP (void)" .br .RI "Reopens the logfile\&. " .ti -1c .RI "virtual void \fBclose\fP (void)" .br .RI "Closes the logfile\&. " .ti -1c .RI "virtual bool \fBis_valid\fP (void) const" .br .RI "Check if the appender is valid\&. " .ti -1c .RI "virtual void \fBset_append\fP (bool \fBappend\fP)" .br .RI "Sets the append vs truncate flag\&. " .ti -1c .RI "virtual bool \fBget_append\fP (void) const" .br .RI "Gets the value of the 'append' option\&. " .ti -1c .RI "virtual void \fBset_mode\fP (mode_t mode)" .br .RI "Sets the file open mode\&. " .ti -1c .RI "virtual mode_t \fBget_mode\fP () const" .br .RI "Gets the file open mode\&. " .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual int \fB_append\fP (const \fBLoggingEvent\fP &event)" .br .RI "Log in \fBAppender\fP specific way\&. " .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "const std::string \fB_file_name\fP" .br .ti -1c .RI "int \fB_fd\fP" .br .ti -1c .RI "int \fB_flags\fP" .br .ti -1c .RI "mode_t \fB_mode\fP" .br .in -1c .SS "Additional Inherited Members" .SH "Constructor & Destructor Documentation" .PP .SS "log4tango::FileAppender::FileAppender (const std::string & name, const std::string & fileName, bool append = \fCtrue\fP, mode_t mode = \fC00644\fP)" .PP Constructs a \fBFileAppender\fP\&. .PP \fBParameters\fP .RS 4 \fIname\fP the name of the \fBAppender\fP\&. .br \fIfileName\fP the name of the file to which the \fBAppender\fP has to log\&. .br \fIappend\fP whether the \fBAppender\fP has to truncate the file or just append to it if it already exists\&. Defaults to 'true'\&. .br \fImode\fP file mode to open the logfile with\&. Defaults to 00644\&. .RE .PP .SS "log4tango::FileAppender::FileAppender (const std::string & name, int fd)" .PP Constructs a \fBFileAppender\fP to an already open file descriptor\&. .PP \fBParameters\fP .RS 4 \fIname\fP the name of the \fBAppender\fP\&. .br \fIfd\fP the file descriptor to which the \fBAppender\fP has to log\&. .RE .PP .SS "log4tango::FileAppender::~FileAppender ()\fC [virtual]\fP" .PP Destructor\&. .SH "Member Function Documentation" .PP .SS "int log4tango::FileAppender::_append (const \fBLoggingEvent\fP & event)\fC [protected]\fP, \fC [virtual]\fP" .PP Log in \fBAppender\fP specific way\&. Subclasses of \fBAppender\fP should implement this method to perform actual logging\&. .PP \fBParameters\fP .RS 4 \fIevent\fP The \fBLoggingEvent\fP to log\&. .RE .PP .PP Implements \fBlog4tango::Appender\fP\&. .PP Reimplemented in \fBlog4tango::RollingFileAppender\fP\&. .SS "void log4tango::FileAppender::close (void)\fC [virtual]\fP" .PP Closes the logfile\&. .PP Implements \fBlog4tango::Appender\fP\&. .SS "bool log4tango::FileAppender::get_append (void) const\fC [virtual]\fP" .PP Gets the value of the 'append' option\&. .SS "mode_t log4tango::FileAppender::get_mode (void) const\fC [virtual]\fP" .PP Gets the file open mode\&. .SS "bool log4tango::FileAppender::is_valid (void) const\fC [virtual]\fP" .PP Check if the appender is valid\&. .PP \fBReturns\fP .RS 4 true if the appender is valid, false otherwise\&. .RE .PP .PP Reimplemented from \fBlog4tango::Appender\fP\&. .SS "bool log4tango::FileAppender::reopen (void)\fC [virtual]\fP" .PP Reopens the logfile\&. This can be useful for logfiles that are rotated externally, e\&.g\&. by logrotate\&. This method is a NOOP for FileAppenders that have been constructed with a file descriptor\&. .br .PP \fBReturns\fP .RS 4 true if the reopen succeeded\&. .RE .PP .PP Reimplemented from \fBlog4tango::Appender\fP\&. .SS "void log4tango::FileAppender::set_append (bool append)\fC [virtual]\fP" .PP Sets the append vs truncate flag\&. NB\&. currently the \fBFileAppender\fP opens the logfile in the constructor\&. Therefore this method is too late to influence the first file opening\&. We'll need something similar to log4j's activateOptions()\&. .PP \fBParameters\fP .RS 4 \fIappend\fP false to truncate, true to append .RE .PP .SS "void log4tango::FileAppender::set_mode (mode_t mode)\fC [virtual]\fP" .PP Sets the file open mode\&. .SH "Member Data Documentation" .PP .SS "int log4tango::FileAppender::_fd\fC [protected]\fP" .SS "const std::string log4tango::FileAppender::_file_name\fC [protected]\fP" .SS "int log4tango::FileAppender::_flags\fC [protected]\fP" .SS "mode_t log4tango::FileAppender::_mode\fC [protected]\fP" .SH "Author" .PP Generated automatically by Doxygen for log4tango from the source code\&.