Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > 806b8574900c6f644b03d5eb76e60aef > files > 90

log4c-doc-1.2.4-1.fc18.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>log4c: Log4c : Logging for C Library</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">log4c
   &#160;<span id="projectnumber">1.2.4</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Log4c : Logging for C Library </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"> 
<center>
<a href="#summary">Summary</a>
<a href="#requirements">Requirements</a>
<a href="#installation">Installation</a>
<a href="#config">Configuration</a>
<a href="#custom">Customization</a>
<a href="#thanks">Thanks</a>
<a href="#copyright">Copyright</a>
</center>
<h1><a class="anchor" id="summary"></a>
Summary</h1>
<p>Log4c is a library of C for flexible logging to files, syslog and other destinations. It is modeled after the Log for Java library (<a href="http://jakarta.apache.org/log4j/">http://jakarta.apache.org/log4j/</a>), staying as close to their API as is reasonable. Here is a <a href="http://logging.apache.org/log4j/1.2/manual.html">short introduction</a> to Log4j which describes the API, and design rationale.</p>
<p>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.</p>
<p>Log4c is also available from SourceForge (<a href="http://www.sourceforge.net/projects/log4c/">http://www.sourceforge.net/projects/log4c/</a>). This is work in progress.</p>
<h1><a class="anchor" id="requirements"></a>
Requirements</h1>
<h2><a class="anchor" id="platforms"></a>
Platforms</h2>
<p>log4c was successfully compiled and run on the following platforms:</p>
<ul>
<li>HP-UX release 11.00 </li>
<li>Tru 64 release 4.0F and 5.1 </li>
<li>Red Hat Linux Intel release 7.x, 8, 9 </li>
<li>Red Hat Enterprise Linux 3, 4 </li>
<li>Solaris Intel release 8, 9, 10 </li>
<li>FreeBSD 6.1-RELEASE </li>
<li>AIX 5.3 (with xlc compiler) </li>
<li>Mac OS X </li>
<li>Windows X </li>
<li>...and other Linux distributions</li>
</ul>
<p>log4c should compile and run on the following platforms:</p>
<ul>
<li>The BSD family </li>
<li>MS Windows</li>
</ul>
<h2><a class="anchor" id="software"></a>
Software</h2>
<p>The following software is needed to generate log4c:</p>
<ul>
<li><a href="http://gcc.gnu.org">GCC</a> 3.0.1+, to generate log4c, but hopefully not to use it. </li>
<li><a href="http://www.stack.nl/~dimitri/doxygen/index.html">doxygen</a> 1.2.13+, a documentation system for C/C++ needed to generate the documentation. </li>
<li><a href="http://www.graphviz.org/">graphviz</a>, the AT&amp;T Graph Visualization Tools also needed to generate the documentation.</li>
</ul>
<p>For the moment, log4c uses specific GCC extensions, like <code><b>attribute</b></code>, so you will need GCC to compile it. This will probably change one day.</p>
<h1><a class="anchor" id="installation"></a>
Installation</h1>
<h2><a class="anchor" id="installation_tarballs"></a>
Building from source tarballs</h2>
<p>on SourceForge: </p>
<ul>
<li><a href="http://prdownloads.sourceforge.net/log4c/log4c-1.2.4.tar.gz">log4c-1.2.4.tar.gz</a></li>
</ul>
<p>The log4c package uses the GNU autotools compilation and installation framework. The following commands should build log4c on the supported platforms:</p>
<div class="fragment"><div class="line">$ gzip -dc log4c-1.2.4.tar.gz | tar tvf -</div>
<div class="line">$ cd log4c-1.2.4/</div>
<div class="line">$ ./configure --prefix=/path/of/installation</div>
<div class="line">$ make</div>
<div class="line">$ make install</div>
</div><!-- fragment --><p>Checkout the <code>INSTALL</code> file for installation and the generated doxygen documentation for more information.</p>
<h1><a class="anchor" id="config"></a>
Configuration</h1>
<h2><a class="anchor" id="conf_files"></a>
Configuration files</h2>
<p>log4c searches the following files to load its configuration:</p>
<ul>
<li><code>${LOG4C_RCPATH}/log4crc</code> </li>
<li><code>${HOME}/</code>.log4crc </li>
<li><code></code>./log4crc</li>
</ul>
<p>The environment variable <code>LOG4C_RCPATH</code> holds the prefix used for installation.</p>
<h2><a class="anchor" id="conf_syntax"></a>
Configuration syntax</h2>
<p>The <code>log4crc</code> configuration file uses an XML syntax. The root element is <code></code> &lt;log4c&gt; and it can be used to control the configuration file version interface with the attribute <code>"version"</code>. The following 4 elements are supported: <code></code> &lt;config&gt;, <code></code> &lt;category&gt;, <code></code> &lt;appender&gt; and <code></code> &lt;layout&gt;.</p>
<ul>
<li>The <code></code> &lt;config&gt; element controls the global log4c configuration. It has 3 sub elements. The <code></code> &lt;nocleanup&gt; flag inhibits the log4c destructors routines. The <code></code> &lt;bufsize&gt; element sets the buffer size used to format <a class="el" href="structlog4c__logging__event__t.html" title="logging event object">log4c_logging_event_t</a> objects. If is set to 0, the allocation is dynamic (the <code></code> &lt;debug&gt; element is currently unused).</li>
</ul>
<ul>
<li>The <code></code> &lt;category&gt; element has 3 possible attributes: the category <code>"name"</code>, the category <code>"priority"</code> and the category <code>"appender"</code>. Future versions will handle multiple appenders per category.</li>
</ul>
<ul>
<li>The <code></code> &lt;appender&gt; element has 3 possible attributes: the appender <code>"name"</code>, the appender <code>"type"</code>, and the appender <code>"layout"</code>.</li>
</ul>
<ul>
<li>The <code></code> &lt;layout&gt; element has 2 possible attributes: the layout <code>"name"</code> and the layout <code>"type"</code>.</li>
</ul>
<p>Here's the <code>log4crc</code> configuration file example:</p>
<div class="fragment"><div class="line">&lt;?xml version=<span class="stringliteral">&quot;1.0&quot;</span> encoding=<span class="stringliteral">&quot;ISO-8859-1&quot;</span>?&gt;</div>
<div class="line">&lt;!DOCTYPE log4c SYSTEM <span class="stringliteral">&quot;&quot;</span>&gt;</div>
<div class="line"></div>
<div class="line">&lt;log4c&gt;</div>
<div class="line"></div>
<div class="line">        &lt;config&gt;</div>
<div class="line">                &lt;bufsize&gt;0&lt;/bufsize&gt;</div>
<div class="line">                &lt;debug level=<span class="stringliteral">&quot;0&quot;</span>/&gt;</div>
<div class="line">                &lt;nocleanup&gt;0&lt;/nocleanup&gt;</div>
<div class="line">        &lt;/config&gt;</div>
<div class="line"></div>
<div class="line">        &lt;!-- root category ========================================= --&gt;</div>
<div class="line">        &lt;category name=<span class="stringliteral">&quot;root&quot;</span> priority=<span class="stringliteral">&quot;notice&quot;</span>/&gt;</div>
<div class="line"></div>
<div class="line">        &lt;!-- <span class="keywordflow">default</span> appenders ===================================== --&gt;</div>
<div class="line">        &lt;appender name=<span class="stringliteral">&quot;stdout&quot;</span> type=<span class="stringliteral">&quot;stream&quot;</span> layout=<span class="stringliteral">&quot;basic&quot;</span>/&gt;</div>
<div class="line">        &lt;appender name=<span class="stringliteral">&quot;stderr&quot;</span> type=<span class="stringliteral">&quot;stream&quot;</span> layout=<span class="stringliteral">&quot;dated&quot;</span>/&gt;</div>
<div class="line">        &lt;appender name=<span class="stringliteral">&quot;syslog&quot;</span> type=<span class="stringliteral">&quot;syslog&quot;</span> layout=<span class="stringliteral">&quot;basic&quot;</span>/&gt;</div>
<div class="line"></div>
<div class="line">        &lt;!-- <span class="keywordflow">default</span> layouts ======================================= --&gt;</div>
<div class="line">        &lt;layout name=<span class="stringliteral">&quot;basic&quot;</span> type=<span class="stringliteral">&quot;basic&quot;</span>/&gt;</div>
<div class="line">        &lt;layout name=<span class="stringliteral">&quot;dated&quot;</span> type=<span class="stringliteral">&quot;dated&quot;</span>/&gt;</div>
<div class="line">&lt;/log4c&gt;</div>
</div><!-- fragment --><p>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.</p>
<h2><a class="anchor" id="env"></a>
Environment variables</h2>
<ul>
<li><code>LOG4C_RCPATH</code> holds the path to the main <code>log4crc</code> configuration file </li>
<li><code>LOG4C_PRIORITY</code> holds the <code>"root"</code> category priority </li>
<li><code>LOG4C_APPENDER</code> holds the <code>"root"</code> category appender</li>
</ul>
<h1><a class="anchor" id="custom"></a>
Customization</h1>
<p>This section will, one day, briefly describe how to define custom appenders and custom layouts. Be patient or checkout the source.</p>
<h1><a class="anchor" id="thanks"></a>
Thanks</h1>
<p>Mark Mendel for his work on a previous version of log4c.</p>
<p>This project would not have existed without Ceki Gulcu, the creator and maintainer of <a href="http://jakarta.apache.org/log4j">Log4j</a>, nor without Bastiaan Bakker, who initiated me with <a href="http://log4cpp.sourceforge.net/">Log4Cpp</a>.</p>
<p>Many thanks to</p>
<ul>
<li>Joel Schaubert for many contributions </li>
<li>Robert Byrne for Windows port and also many contributions </li>
<li>Olger Warnier for the Mac OS X port </li>
<li>Jeff Smith for writing a primer on <a href="http://jefficus.usask.ca/article.php?story=20040613140849924">how to use Log4c effectively</a></li>
</ul>
<h1><a class="anchor" id="copyright"></a>
Copyright</h1>
<p>All software in this package is Copyright (C) 2003-2004 Meiosys <a href="http://www.meiosys.com">http://www.meiosys.com</a> and Cedric Le Goater and is distributed under the <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a> License. See the <code>COPYING</code> file for full legal details. </p>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.3.1
</small></address>
</body>
</html>