Log4c : Logging for C Library

1.2.1

Summary Requirements Installation Configuration Customization Thanks Copyright

Summary

Log4c is a library of C for flexible logging to files, syslog and other destinations. It is modeled after the Log for Java library (http://jakarta.apache.org/log4j/), staying as close to their API as is reasonable. Here is a short introduction to Log4j which describes the API, and design rationale.

Mark Mendel started a parallel log4c projet with a different philosophy. The design is macro oriented, so much lighter and faster which perfect for kernel development.

Log4c is also available from SourceForge (http://www.sourceforge.net/projects/log4c/). This is work in progress.

Requirements

Platforms

log4c was successfully compiled and run on the following platforms :

log4c should compile and run on the following platforms :

Software

The following softwares are needed to generate log4c:

For the moment, log4c uses specific GCC extensions, like __attribute__, so you will need GCC to compile it. This will probably change one day.

Installation

Building from source tarballs

on SourceForge: The log4c package uses the GNU autotools compilation and installation framework. The following commands should build log4c on the supported platforms:

$ gzip -dc log4c-1.2.1.tar.gz | tar tvf -
$ cd log4c-1.2.1/
$ ./configure --prefix=/path/of/installation
$ make
$ make install

Checkout the INSTALL file for installation and the generated doxygen documentation for more information.

Using RPMs

FC7 RPMs on SourceForge: The following command install the log4c RPMs :

$ sudo rpm -Uvh log4c-1.2.1.i386.rpm log4c-devel-1.2.1.i386.rpm

Configuration

Configuration files

log4c searches the folloging files to load its configuration:

The environment variable LOG4C_RCPATH holds the prefix used for installation.

Configuration syntax

The log4crc configuration file uses an XML syntax. The root element is <log4c> and it can be used to control the configuration file version interface with the attribute "version". The following 4 elements are supported: <config>, <category>, <appender> and <layout>.

Here's the default log4crc configuration file:

This initial version of the log4c configuration file syntax is quite different from log4j. XML seemed the best choice to keep the log4j configuration power in a C API.

Environment variables

Customization

This section will, one day, briefly describe how to define custom appenders and custom layouts. Be patient or checkout the source.

Thanks

Mark Mendel for his work on a previous version of log4c.

This project would not have existed without Ceki Gulcu, the creator and maintainer of Log4j, nor without Bastiaan Bakker, who intiated me with Log4Cpp.

Many thanks to

Copyright

All software in this package is Copyright (C) 2003-2004 Meiosys http://www.meiosys.com and Cedric Le Goater and is distributed under the LGPL License. See the COPYING file for full legal details.

Generated on Sun Jul 5 12:43:59 2009 for log4c by  doxygen 1.5.8