📄 index.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><html><head> <title>Log for C++</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="GENERATOR" content="Quanta Plus"> <link HREF="default.css" TYPE="text/css" REL="STYLESHEET" ></head><body><div align="center"><h1>Log for C++</h1></div><h2>Introduction</h2><p>Log4cpp is library of C++ classes for flexible logging to files, syslog, IDSA and other destinations.It is modeled after the <a href="http://jakarta.apache.org/log4j">Log4j</a> Java library, staying as close to their API as is reasonable.</p><h2>Download</h2><p>Sources are available from SourceForges <a href="http://sourceforge.net/project/showfiles.php?group_id=15190">download page</a>.<br>We do not supply binaries yet, because of the numerous incompatible ABIs (e.g. g++ 2.95 vs 2.96 vs 3.0 vs 3.2) and different packageformats.<br>An older version of log4cpp (0.2.5) is available in Debian stable,see <a href="http://packages.debian.org/stable/libs/liblog4cpp0.html">http://packages.debian.org/stable/libs/liblog4cpp0.html</a>.<br>FreeBSD users can find log4cpp (0.2.7) in the ports collection,see <a href="http://www.freebsd.org/ports/devel.html#log4cpp-0.2.7">http://www.freebsd.org/ports/devel.html</a><br>The people of the <a href="http://datagrid.in2p3.fr/">Datagrid Project Central Repository</a> have published the source and binary RPMsthey use theirselves. These are for RedHat Linux 6.2.<br>Pascal Bleser has built RPMs for SuSE Linux and made them available at <a href="http://guru.unixtech.be/rpm/packages/Development/log4cpp/">http://guru.unixtech.be/rpm/packages/Development/log4cpp/</a><br>Log4cpp includes support for building RPMs, so building your own from the source tar-ball is as simple as<pre>rpm -ta log4cpp-x.y.z.tar.gz</pre></p><h2>Building Log4cpp</h2><p>As of version 0.2.0 log4cpp can be build using autoconf on platforms that support it. Simply do:<pre>./configuremakemake checkmake install</pre><p>This will install log4cpp under /usr/local. To install in another localation specify --prefix=<location> when running configure.</p><h3>Options for ./configure</h3>Besides the usual ./configure options like --prefix a few others are available:<dl><dt>--with-idsa</dt><dd>Include support for logging to IDSA (<a href="http://jade.cs.uct.ac.za/idsa/index.html">http://jade.cs.uct.ac.za/idsa/index.html</a>).This will give you an IdsaAppender Appender class.</dd></dl><dl><dt>--with-omnithreads[=<path-to-omniORB>]</dt><dd>Enable multi-threading support using omniORB4's omniThreads MT abstraction library (http://www.omniorb.org).configure expects the omnithread header files to reside in <path-to-omniORB>/include and the library in<path-to-omniORB</lib, i.e. not in a platform specific subdirectory. Create symlinks where necessary.<br>NB. omniORB4 is required: omniORB3 will not suffice as it lacks sufficient support for thread specific data.At the moment (August 2002) omniORB4 is in beta, however most parts and specifically the threadinglibrary appear to be quite stable.</dd></dl><dl><dt>--with-pthreads</dt><dd>Enable multi-threading support using the 'pthread' POSIX threads library.This option is mutually exclusive with --with-omnithreads.<dd></dl><dl><dt>--enable-doxyen</dt><dd>Enables generation of API documentation by Dimitri van Heeschs Doxygen tool(http://www.doxygen.org/). Defaults to yes if doxygen can be found in thesearch path.</dd></dl><dl><dt>--enable-html-docs</dt><dd>If doxygen is enabled, have it generate HTML formatted documentation.</dd></dl><dl><dt>--enable-latex-docs</dt><dd>If doxygen is enabled, have it generate LaTeX formatted documentation.</dd></dl><dl><dt> --enable-dot</dt><dd>Let Doxygen use the 'dot' tool of GraphViz (<a href="http://www.graphviz.org/">http://www.graphviz.org</a>) todraw its graphs.</dd></dl></p><h3>Build notes for specific platforms</h3><dl><dt>*nix - g++ compiler</dt><dd>Log4cpp should build whitout modification on any decent *nix system with g++ and GNU make. The primary development platform isRedHat Linux 7.3, which has g++ 2.96-rh, but the aim is to be compatible with from g++ 2.95 and up. When g++ 3.x has been widelyadopted we may drop support for older g++ versions.</dd></dl><dl><dt>Solaris - Sun CC compiler</dt><dd>Compilation with Suns CC compiler requires setting some enviroment variables.Also static libraries appear not to work. In short do:<pre>CC=CC CXX=CC LD="CC -KPIC" ./configure --disable-static</pre></dd></dl><dl><dt>Win32 - MSVC++ 6</dt><dd>Use the workspace and project files in subdirectory msvc6.You may need to adjust include/log4cpp/config-win32.h and the project files to your particular needs.</dd><dl><dt>Win32 - MSVC++ 5</dt><dd>Building log4cpp with MSVC++ 5 is not supported and will not be,unless someone can find a way to do so without mutilating the source code.</dd></dl><dl><dt>Win32 - Borland C++ Builder 5</dt><dd>Use the project and make files in subdirectory bcb5.</dd></dl><dl><dt>Win32 - Cygwin</dt><dd>Use './configure; make; make install'.<br>Be warned that there have been very few success or failure reports for this platform,so either it works very smoothly or noone actively uses log4cpp with Cygwin :-)</dd></dl><dl><dt>OpenVMS<dt><dd>Edit include/log4cpp/config-openvms.h if you need different settings.<br>This has been tested on OpenVMS Alpha v7.3 and Compaq C++ V6.3-020 only.</dd><dd>1) Copy the src and include directory (including all its contents and subdirectories) onto your OpenVMS system.</dd><dd>2) Compile each source file (*.CPP and *.C in the src directory) one by one by the following command,<pre>cxx /include=("/a1\$dkb0/user/tony/project/log4cpp/include") /define=(__USE_STD_IOSTREAM,__OPENVMS__) /repository=a1$dkb0:[user.tony.project.log4cpp.repository] APPENDER.CPPcxx /include=("/a1\$dkb0/user/tony/project/log4cpp/include") /define=(__USE_STD_IOSTREAM,__OPENVMS__) /repository=a1$dkb0:[user.tony.project.log4cpp.repository] APPENDERSKELETON.CPP</pre>...etc<br>Please substitute a correct path for your include directory. A unix-style directory name is requied in the /include parameter.In this example, the pathis A1$DKBO:[USER.TONY.PROJECT.LOG4CPP.INCLUDE]<br>A repository directory is also specified here as A1$DKB0:[USER.TONY.PROJECT.LOG4CPP.REPOSITORY].<br><dd>3) Create a static library, LOG4CPP.OLB<pre>lib/create log4cpp</pre></dd><dd>4) Put all compiled OBJ files into the LOG4CPP.OLB<pre>lib/insert log4cpp appenderlib/insert log4cpp appenderskeleton</pre>...etc<br></dd><dd>5) Link a program with log4cpp.olb. e.g:<pre>cxx /include=("/a1\$dkb0/user/tony/project/log4cpp/include") /define=(__USE_STD_IOSTREAM,__OPENVMS__) testlog4cpp.cxxcxxlink /repository=a1$dkb0:[user.tony.project.log4cpp.repository] testlog4cpp,log4cpp/library</pre></dd></dl><h2>Releases</h2><p>WARNING: releases from the development branch are a 'work in progress' and may fail to build, crash or redecorate your desktop.<dl><dt>0.3.4b - development branch (29 October 2002)</dt><dd>Fixed builds for MSVC6 and MSVC7 this time, honestly :-).</dd></dl><dl><dt>0.3.4 - development branch (28 October 2002)</dt><dd>Fixed builds for MSVC6 and MSVC7.</dd><dd>Removed Log4cppCleanup.</dd></dl><dl><dt>0.3.3 - development branch (26 October 2002)</dt><dd>Fixed #628211: build failure on MSVC 6.0.</dd><dd>Fixed #625811: log facility in RemoteSyslogAppender.</dd><dd>Possibly fixed #415160: crashes with dynamic library on Solaris 2.6.</dd><dd>Replaced PatternLayout with a new, faster and more complete implementation.</dd></dl><dl><dt>0.3.2 - development branch (5 October 2002)</dt><dd>Fixed #614903: compilation problem on Sun CC 5.3.</dd><dd>Added missing MSVC6 .dsp files.</dd><dd>Fixed log facility in RemoteSyslogAppender.</dd><dd>Fixed relocatability of log4cpp-devel RPM.</dd><dd></dd></dl><dl><dt>0.3.2rc5 - development branch (5 October 2002)</dt><dd>Merged #604991: support for setting additivy in PropertyConfig.</dd><dd>Merged #605143: support for compilation in QNX Neutrino.</dd></dl><dl><dt>0.3.2rc4 - development branch (16 August 2002)</dt><dd>Fixed last minute goof ups which prevented compilation on both *nix and Win32 platforms.</dd></dl><dl><dt>0.3.2rc2 - development branch (12 August 2002)</dt><dd>Added support for POSIX threads.</dd><dd>Added PropertyConfigurator.</dd><dd>Rearranged documentation.</dd><dd>Fixed various bugs.</dd></dl><dl><dt>0.3.2rc1 - development branch (19 June 2002)</dt>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -