Differences between revisions 6 and 7
Revision 6 as of 2008-05-17 19:38:41
Size: 2844
Editor: HaiZaar
Comment: Added question about configuring log4cxx programmatically
Revision 7 as of 2009-09-20 23:45:57
Size: 2854
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
  See also [http://logging.apache.org/log4cxx/ here]. The current stable version 0.9.7 is outdated and contains some significant bugs, so that it should not be used anymore. The new version 0.10.0 has been recently released.   See also [[http://logging.apache.org/log4cxx/|here]]. The current stable version 0.9.7 is outdated and contains some significant bugs, so that it should not be used anymore. The new version 0.10.0 has been recently released.
Line 9: Line 9:
  A nightly build is performed on [http://gump.apache.org/ GUMP], based on the ant build system.
  To make sure that the GNU autotools based build system also works properly, a nightly (unofficial) build based on it is created at [http://www.littletux.net/log4cxx]. This build also executes the unit tests. The build is based on SVN HEAD, but usually contains some additional patches which are not yet in committed to the SVN repository. The platform is a Debian GNU/Linux 3.1 System using gcc 3.3.5.
  A nightly build is performed on [[http://gump.apache.org/|GUMP]], based on the ant build system.
  To make sure that the GNU autotools based build system also works properly, a nightly (unofficial) build based on it is created at [[http://www.littletux.net/log4cxx]]. This build also executes the unit tests. The build is based on SVN HEAD, but usually contains some additional patches which are not yet in committed to the SVN repository. The platform is a Debian GNU/Linux 3.1 System using gcc 3.3.5.
Line 13: Line 13:
  Log4cxx is patterned after the log4j API, so the [https://www.qos.ch/shop/products/log4j/log4j-Manual.jsp log4j book] should go a long way towards getting your head around using the C++ API. The two should be functionally and structurally equivalent (down to the bugs). It would be nice to compile a list of good log4cxx or generic log4j examples on the OtherResources page.   Log4cxx is patterned after the log4j API, so the [[https://www.qos.ch/shop/products/log4j/log4j-Manual.jsp|log4j book]] should go a long way towards getting your head around using the C++ API. The two should be functionally and structurally equivalent (down to the bugs). It would be nice to compile a list of good log4cxx or generic log4j examples on the OtherResources page.
Line 16: Line 16:
  Have you seen the [http://logging.apache.org/log4cxx/faq.html formal faq] for log4cxx? Your question may be answered there. Also feel free to help build up this FAQ on the Wiki.   Have you seen the [[http://logging.apache.org/log4cxx/faq.html|formal faq]] for log4cxx? Your question may be answered there. Also feel free to help build up this FAQ on the Wiki.
  • What is the current state of the project?
    • See also here. The current stable version 0.9.7 is outdated and contains some significant bugs, so that it should not be used anymore. The new version 0.10.0 has been recently released.

  • How can the current SVN head be built?
    • SVN Head contains two build systems, one based on ant and one based on GNU autotools. The ant based build system runs on all supported platforms, while the GNU autotools mechanism is restricted to POSIX platforms. The ant based build system also automatically downloads and builds the APR libraries, while the GNU autotools mechanism requires those libraries to be already available.
  • Are there binaries available?
    • A nightly build is performed on GUMP, based on the ant build system. To make sure that the GNU autotools based build system also works properly, a nightly (unofficial) build based on it is created at http://www.littletux.net/log4cxx. This build also executes the unit tests. The build is based on SVN HEAD, but usually contains some additional patches which are not yet in committed to the SVN repository. The platform is a Debian GNU/Linux 3.1 System using gcc 3.3.5.

  • Where can I learn more? / Is there a log4cxx book?
    • Log4cxx is patterned after the log4j API, so the log4j book should go a long way towards getting your head around using the C++ API. The two should be functionally and structurally equivalent (down to the bugs). It would be nice to compile a list of good log4cxx or generic log4j examples on the OtherResources page.

  • This FAQ seems short, don't people ask other questions, or am I the only one not getting it?
    • Have you seen the formal faq for log4cxx? Your question may be answered there. Also feel free to help build up this FAQ on the Wiki.

  • In <<Short introduction to log4cxx>>, it's said "The log4cxx environment is fully configurable programmatically." - But how do I do this?

    • For starters:
      • #include <log4cxx/logger.h>
        #include <log4cxx/helpers/pool.h>
        #include <log4cxx/basicconfigurator.h>
        #include <log4cxx/fileappender.h>
        #include <log4cxx/simplelayout.h>
        
        int main() {
           log4cxx::FileAppender * fileAppender = new
        log4cxx::FileAppender(log4cxx::LayoutPtr(new log4cxx::SimpleLayout()),
        "logfile", false);
        
           log4cxx::helpers::Pool p;
           fileAppender->activateOptions(p);
        
           log4cxx::BasicConfigurator::configure(log4cxx::AppenderPtr(fileAppender));
           log4cxx::Logger::getRootLogger()->setLevel(log4cxx::Level::getDebug());
           log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger("logger");
        
           LOG4CXX_INFO(logger,"Created FileAppender appender");
        
           return 0;
        }

FrequentlyAskedQuestions (last edited 2009-09-20 23:45:57 by localhost)