Log4gFileAppender

Log4gFileAppender — Log events to a file

Synopsis

                    Log4gFileAppender;
                    Log4gFileAppenderClass;
void                log4g_file_appender_close_file      (Log4gAppender *base);
guint               log4g_file_appender_get_buffer_size (Log4gAppender *base);
gboolean            log4g_file_appender_get_buffered_io (Log4gAppender *base);
const gchar *       log4g_file_appender_get_file        (Log4gAppender *base);
void                log4g_file_appender_set_file_full   (Log4gAppender *base,
                                                         const gchar *file,
                                                         gboolean append,
                                                         gboolean buffered,
                                                         guint size);
void                log4g_file_appender_set_qw_for_files
                                                        (Log4gAppender *base,
                                                         FILE *file);
void                (*Log4gFileAppenderSetFileFull)     (Log4gAppender *base,
                                                         const gchar *file,
                                                         gboolean append,
                                                         gboolean buffered,
                                                         guint size);
void                (*Log4gFileAppenderSetQwForFiles)   (Log4gAppender *base,
                                                         FILE *file);

Description

The file appender logs events to a regular text file.

File appenders accept the following properties:

  1. file

  2. append

  3. buffered-io

  4. buffer-size

The value of file specifies the location of the output. This may be an absolute or relative path.

The value of append determines if the file will be truncated when it is opened for writing. The default value is TRUE (i.e. do not truncate).

The value of buffered-io determines if file I/O will be buffered. Buffered I/O may exhibit improved performance, however messages in the buffer will be lost if your application crashes. Buffering is turned off by default.

The buffer-size property controls the size of the I/O buffer. The default value is eight kilobytes (8192 bytes).

Details

Log4gFileAppender

typedef struct {
} Log4gFileAppender;

The Log4gFileAppender structure does not have any public members.


Log4gFileAppenderClass

typedef struct {
    Log4gFileAppenderSetFileFull set_file_full;
    Log4gFileAppenderSetQwForFiles set_qw_for_files;
} Log4gFileAppenderClass;

Log4gFileAppenderSetFileFull set_file_full;

Set the file and other options.

Log4gFileAppenderSetQwForFiles set_qw_for_files;

Set the quiet writer used for output.

log4g_file_appender_close_file ()

void                log4g_file_appender_close_file      (Log4gAppender *base);

Close the log file.

Once a file appender is closed it is no longer usable.

base :

A file appender object.

Since 0.1


log4g_file_appender_get_buffer_size ()

guint               log4g_file_appender_get_buffer_size (Log4gAppender *base);

Retrieve the buffer-size property.

base :

A file appender object.

Returns :

The buffer-size value for \e base.

Since 0.1


log4g_file_appender_get_buffered_io ()

gboolean            log4g_file_appender_get_buffered_io (Log4gAppender *base);

Retrieve the buffered-io property.

base :

A file appender object.

Returns :

The buffered-io value for \e base.

Since 0.1


log4g_file_appender_get_file ()

const gchar *       log4g_file_appender_get_file        (Log4gAppender *base);

Retrieve the file property.

base :

A file appender object.

Returns :

The name of the file being appended to.

Since 0.1


log4g_file_appender_set_file_full ()

void                log4g_file_appender_set_file_full   (Log4gAppender *base,
                                                         const gchar *file,
                                                         gboolean append,
                                                         gboolean buffered,
                                                         guint size);

Calls the set_file_full function from the Log4gFileAppender of self.

base :

A file appender object.

file :

The new value for the file property.

append :

The new value for the append property.

buffered :

The new value for the buffered-io property.

size :

The new value for the size property.

Since 0.1


log4g_file_appender_set_qw_for_files ()

void                log4g_file_appender_set_qw_for_files
                                                        (Log4gAppender *base,
                                                         FILE *file);

Calls the set_qw_for_files function from the Log4gFileAppenderClass of self.

base :

A file appender object.

file :

An open file descriptor.

Since 0.1


Log4gFileAppenderSetFileFull ()

void                (*Log4gFileAppenderSetFileFull)     (Log4gAppender *base,
                                                         const gchar *file,
                                                         gboolean append,
                                                         gboolean buffered,
                                                         guint size);

The rolling file appender overloads this function.

See: Log4gRollingFileAppender

base :

A file appender object.

file :

The new value for the file property.

append :

The new value for the append property.

buffered :

The new value for the buffered-io property.

size :

The new value for the size property.

Since 0.1


Log4gFileAppenderSetQwForFiles ()

void                (*Log4gFileAppenderSetQwForFiles)   (Log4gAppender *base,
                                                         FILE *file);

The rolling file appender overloads this function.

See: Log4gRollingFileAppender, Log4gQuietWriter, stdio(3)

base :

A file appender object.

file :

The open file handle to write to.

Since 0.1