I'm looking for logging framework for C++ project. My best shot was log4cxx, but it seems that it's abandoned project, with development stopped ~4 years ago, with only one update in last 4-5 years.
Anything better that log4cxx? (log4c & log4cpp are also totally out-of-date)...
Update : Boost.Log has been accepted in Boost [1] under conditions and will be available in a coming release. The current target release would be in the end of 2012.
Update 2: Good informations on Boost.Log can be found in these questions:
Another logging library, Boost.Log [4] (by Andrey Semashev, not Boost.Logging by John Torjo) has been proposed to boost and is currently a work in progress.
From the mailing list :
[1] http://lists.boost.org/boost-announce/2010/03/0256.phpThe archive with the library source code, tests and docs is available in the Vault:
The online docs are also available on the SourceForge page:
http://boost-log.sourceforge.net
The latest code snapshot can be downloaded from CVS on the SourceForge project page:
http://sourceforge.net/projects/boost-log
The code should be compatible with Boost 1.38. Might also work with 1.37, but I didn't try.
I'm looking also for the same thing. So far I evaluated:
I still want to look at Boost [7] and the Pantheios [8], but I think ezlogger will be the tool of choice for me. Did I miss some library here? I'd like to make a complete list if possible.
[1] http://log4cplus.sourceforge.net/index.htmlYou can take a look at this article [1], it discribes a simple, typesafe, threadsafe, portable logging mechanism.
[1] http://www.ddj.com/cpp/201804215Checkout Pantheios [1]. Haven't tried this myself, but have the greatest respect for Matthew Wilson.
[1] http://www.pantheios.orgThe Boost Logging [1] framework seem pretty good. I've used it myself on a "toy project" but I haven't really tried it in a large application.
It was however rejected [2] for inclusion in the official Boost library [3], by the author himself. Thats not because its not a good library, it just didn't fit into the Boost library in its current form.
[1] http://torjo.com/log2/doc/html/index.htmlYou may wish to consider the logog library. The documentation can be accessed here:
logog has basic multibyte character support, a no-memory-leak policy, a BSD-style license, runs on Windows and POSIX like systems, it's safe in a multithreaded environment, has very complete documentation, supports Unicode output, and maintains a test framework. Additionally, there are no external dependencies in logog beyond that which most modern compilers already provide -- it doesn't need Boost or STLSoft, for example.
Have a look at the logging library which has been proposed for the Boost C++ libraries.
See: http://torjo.com/log2/doc/html/index.html
I don't think that log4ccxx is abandoned at all. I am actually using the last release of log4cxx in my current project and it works pretty well. Yo can check it here [1]
[1] http://logging.apache.org/log4cxx/changes-report.htmlPantheios is great, but no unicode/wchar_t support. Ditto for google-glog. One advantage of google-glog is that if you use gflags for options parsing, it builds upon it so that debug flags are automatically available for your program. But no wchar_t support is bad.
log4cxx requires apache portable runtime.
log4cplus is kinda primitive.
Boost.Log by Andrey Semashev really looks good. I am going to try it out and see how it goes.
I am just hoping that I don't have to end up rolling my own..
log4cplus - nice API, easy build, but memory leaks. The author does not care about the memory leaks and they will not be fixed I guess (see here)
What you consider leaks are not leaks. The memory gets destroyed and freed properly, as far as I know, at static variables destruction time. IMHO your leak detector is showing false positives here. If your leak detector has any sort for textual output, please share it, attach it to the bug report.
I've used NLog [1] in our native C++ projects. Its primarily a .NET logging framework but it does offer a COM interop out of the box (which admittedly doesn't offer full functionality but the source code is available so you can grab the source and roll your own COM interop exposing the functionality that you need).
[1] http://www.nlog-project.org/I don't see why few updates to log4cxx are a bad thing, necessarily. It's working great in my project.
Nobody has yet mentioned rlog [1]. I'm not sure how thread safe it is. And there is a lot of ugly macro hackery. But it is very fast to have a logging point that is disabled, and it is pretty flexible in choosing what gets logged at runtime.
[1] http://www.arg0.net/rlogI've been using log4cplus [1] for some time. Portable and stable.
[1] http://log4cplus.sourceforge.net/