14

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?

Merav Kochavi
  • 3,945
  • 2
  • 29
  • 37
  • You should try these log frameworks and decide what to use according to your needs. In other words, this is opinion-based question which is off-topic here. – Sergei Nikulov Mar 23 '16 at 12:00
  • Why can't you research things like appenders supported, multithreaded support, and licensing by reading their documentation on your own? – Thomas Owens Mar 23 '16 at 12:12

1 Answers1

34

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.
Merav Kochavi
  • 3,945
  • 2
  • 29
  • 37
  • log4cplus - 2016-01-16 is latest release AFAIK. Look here https://sourceforge.net/projects/log4cplus/files/log4cplus-stable/ Development currently on GitHub https://github.com/log4cplus/log4cplus – Sergei Nikulov Mar 23 '16 at 14:48
  • 1
    I think the most important factor for using log4cxx (or not) is that it requires the Apache Portable Runtime (APR), maybe this is the reason why its last release was in 2008 (version 0.10.0). The other frameworks seem to be actively developed by now (2017). – Wolf Nov 24 '17 at 12:20
  • 1
    @Wolf, thanks for you comment, I checked the latest releases for Log4cxx, Log4cplus and Log4cpp and updated the information accordingly. If this was helpful, please +1 :) – Merav Kochavi Nov 27 '17 at 08:14
  • 1
    :) I already indicated that I found both, Q&A, helpful, despite considered off-topic on SO. This question is quite common and not easy to decide. BTW: Here another discouraging statement about the Apache version https://stackoverflow.com/a/13580525/2932052 – Wolf Nov 27 '17 at 10:12