.TH "appender_type_rollingfile.h" 3 "Mon May 2 2011" "Version 1.2.1" "log4c" \" -*- nroff -*- .ad l .nh .SH NAME appender_type_rollingfile.h \- .PP Log4c rolling file appender interface. .SH SYNOPSIS .br .PP \fC#include \fP .br \fC#include \fP .br \fC#include \fP .br .SS "Functions" .in +1c .ti -1c .RI "LOG4C_API rollingfile_udata_t * \fBrollingfile_make_udata\fP (void)" .br .ti -1c .RI "LOG4C_API int \fBrollingfile_udata_set_logdir\fP (rollingfile_udata_t *rfudatap, char *logdir)" .br .ti -1c .RI "LOG4C_API int \fBrollingfile_udata_set_files_prefix\fP (rollingfile_udata_t *rfudatap, char *prefix)" .br .ti -1c .RI "LOG4C_API int \fBrollingfile_udata_set_policy\fP (rollingfile_udata_t *rfudatap, \fBlog4c_rollingpolicy_t\fP *policyp)" .br .ti -1c .RI "LOG4C_API const char * \fBrollingfile_udata_get_logdir\fP (rollingfile_udata_t *rfudatap)" .br .ti -1c .RI "LOG4C_API const char * \fBrollingfile_udata_get_files_prefix\fP (rollingfile_udata_t *rfudatap)" .br .ti -1c .RI "LOG4C_API long \fBrollingfile_get_current_file_size\fP (rollingfile_udata_t *rfudatap)" .br .in -1c .SS "Variables" .in +1c .ti -1c .RI "__LOG4C_BEGIN_DECLS LOG4C_API const \fBlog4c_appender_type_t\fP \fBlog4c_appender_type_rollingfile\fP" .br .in -1c .SH "Detailed Description" .PP Log4c rolling file appender interface. The rolling file appender implements a logging mechanism of a list of files up to a maximum number. .PP The files are written by default to the current directory with logging names folowing the pattern log.1, log.2 etc. These parameters may be changed using the appropriate setter functions. .PP If the appender fails to open logfiles for writing then the messages are logged to stderr--it will continue to try to open the zero-th file for writing at rollover events so if it succeeds at some point to open that file the messages will start to appear therein and will no longer be sent to stderr. .PP Switching from logging from one file to the next is referred to as a 'rollover event'. .PP The policy that determines when a rollover event should happen is called a 'rolling policy'. .PP A mechanism is provided to allow different rolling policies to be defined. .PP Log4c ships with (and defaults to) the classic size-window rollover policy: this triggers rollover when files reach a maximum size. The first file in the list is always the current file; when a rollover event occurs files are shifted up by one position in the list--if the number of files in the list has already reached the max then the oldest file is rotated out of the window. .PP See the documentation in the \fBrollingpolicy_type_sizewin.h\fP file for more details on the size-win rollover policy. .SH "Function Documentation" .PP .SS "LOG4C_API long rollingfile_get_current_file_size (rollingfile_udata_t *rfudatap)"Get the prefix string in this rolling file appender configuration. .PP \fBParameters:\fP .RS 4 \fIrfudatap\fP the rolling file appender configuration object. .RE .PP \fBReturns:\fP .RS 4 the current size of the file being logged to. .RE .PP .SS "LOG4C_API rollingfile_udata_t* rollingfile_make_udata (void)"Get a new rolling file appender configuration object. .PP \fBReturns:\fP .RS 4 a new rolling file appender configuration object, otherwise NULL. .RE .PP .SS "LOG4C_API const char* rollingfile_udata_get_files_prefix (rollingfile_udata_t *rfudatap)"Get the prefix string in this rolling file appender configuration. .PP \fBParameters:\fP .RS 4 \fIrfudatap\fP the rolling file appender configuration object. .RE .PP \fBReturns:\fP .RS 4 the prefix. .RE .PP .SS "LOG4C_API const char* rollingfile_udata_get_logdir (rollingfile_udata_t *rfudatap)"Get the logging directory in this rolling file appender configuration. .PP \fBParameters:\fP .RS 4 \fIrfudatap\fP the rolling file appender configuration object. .RE .PP \fBReturns:\fP .RS 4 the logging directory. .RE .PP .SS "LOG4C_API int rollingfile_udata_set_files_prefix (rollingfile_udata_t *rfudatap, char *prefix)"Set the prefix string in this rolling file appender configuration. .PP \fBParameters:\fP .RS 4 \fIrfudatap\fP the rolling file appender configuration object. .br \fIprefix\fP the logging files prfix to use. .RE .PP \fBReturns:\fP .RS 4 zero if successful, non-zero otherwise. .RE .PP .SS "LOG4C_API int rollingfile_udata_set_logdir (rollingfile_udata_t *rfudatap, char *logdir)"Set the logging directory in this rolling file appender configuration. .PP \fBParameters:\fP .RS 4 \fIrfudatap\fP the rolling file appender configuration object. .br \fIlogdir\fP the logging directory to set. .RE .PP \fBReturns:\fP .RS 4 zero if successful, non-zero otherwise. .RE .PP .SS "LOG4C_API int rollingfile_udata_set_policy (rollingfile_udata_t *rfudatap, \fBlog4c_rollingpolicy_t\fP *policyp)"Set the rolling policy in this rolling file appender configuration. .PP \fBParameters:\fP .RS 4 \fIrfudatap\fP the rolling file appender configuration object. .br \fIpolicyp\fP the logging files prfix to use. .RE .PP \fBReturns:\fP .RS 4 zero if successful, non-zero otherwise. .RE .PP .SH "Variable Documentation" .PP .SS "__LOG4C_BEGIN_DECLS LOG4C_API const \fBlog4c_appender_type_t\fP \fBlog4c_appender_type_rollingfile\fP"rollingfile appender type definition. .PP This should be used as a parameter to the \fBlog4c_appender_set_type()\fP routine to set the type of the appender. .SH "Author" .PP Generated automatically by Doxygen for log4c from the source code.