log4j based loggers: log4cpp vs log4cplus vs log4cxx

Merav Kochavi picture Merav Kochavi · Mar 23, 2016 · Viewed 13.6k times · Source

I would like to replace my current logger, which logs native C++ code, with one of the loggers modeled after log4j. I intend for the logger to create a log which is formatted as the log4j format so that it can be viewed using the Log4View viewer.

I am looking for information such as the pros/cons of each and the differences between them.

i.e. any known memory leaks? any performance testing done which can be reported? any known issues which should be taken into consideration?

Answer

Merav Kochavi picture Merav Kochavi · Mar 23, 2016

From my initial research I have found the following:

Log4cxx: https://logging.apache.org/log4cxx/

  • currently undergoing Incubation - there is no official release
  • update/bug fixes once in the past 12 years, last release was 2008
  • user can select different LogLevels – TRACE, DEBUG, INFO, WARN, ERROR, and FATAL
  • hierarchical Loggers
  • it is possible to log asynchronously
  • supports multiple appenders
  • user can select to enabled or disabled the logger
  • log can be sent to different and multiple output targets
  • user selected output formats
  • well documented
  • is licensed under the Apache License, an open source license certified by the Open Source Initiative
  • requires the Apache Portable Runtime (APR)

Log4cplus: https://sourceforge.net/projects/log4cplus/

  • regular updates/bug fixes - last release was Feb. 2017
  • user can select select different LogLevels – TRACE, DEBUG, INFO, WARN, ERROR, and FATAL
  • hierarchical Loggers
  • supports multi–threaded applications but is not safe to be used from asynchronous signals’ handlers
  • user selected output format: SimpleLayout, PatternLayout, TTCCLayout
  • supports multiple loggers
  • not well documented
  • is licensed under the Apache License V2.0

Log4cpp: https://sourceforge.net/projects/log4cpp/

  • bug fixes are about once a year, last release was August 2016
  • supports multi-threaded applications
  • no clear documentation exist
  • is licensed under the GNU Lesser General Public License (LGPL) as of version 0.2.1, before that have been released under the GPL.