Home

Václav Haisman

log4cplus

log4cplus logo

Welcome to the log4cplus project!

Summary

log4cplus is a simple to use C++ logging API providing thread-safe, flexible, and arbitrarily granular control over log management and configuration. It is modelled after the Java log4j API.

This project is now in "Production" status. See project status page.

Please feel free to contact me if you have any questions or if you would like to help the project: wilx@users.sourceforge.net.

If you want to get help with log4cplus use or compilation or if you have any other problem with it, please use the tracker or the log4cplus-devel mailing list. For bug reporting instructions see bug reporting instructions.

If you want to contribute changes to log4cplus, please see the Development wiki page for more information.

Download

Download from SourceForge.

Documentation

See Doxygen generated log4cplus API documentation for current stable release.

See README for documentation of configure script options and portability related notes. Release procedure is documented in docs/release.txt.

If you are looking for sample code to show you have to use log4cplus, go to code examples.

Mission statement

The aim of this project is to develop log4j-like logging framework for use in (primarily) C++. One of the major design goals is to avoid huge dependencies (like Boost) in the core functionality and to use as standard C++ facilities instead.

News

log4cplus 2.0.0-RC1 released

by Václav Haisman 2017-02-01

I have released log4cplus 2.0.0-RC1. It is the first C++11 based release.

  • IMPORTANT: Implementation language is now C++11. OS specific implementations have been replaced by C++11 facilities wherever possible. This lowers complexity of the library and improves maintainability but it also brings limitations to when the library can be used. Specifically, the library should not be used before main() is entered and after main() is left. Even more specifically, the library should not be used during global objects construction and destruction.

  • log4cplus uses Catch unit testing framework and hand unit tests.

  • log4cplus supports IPv6.

  • Autotools based build system is now partially generated from templates by the Autogen tool.

  • Autotools based build system can build both wchar_t and plain char variants at once.

log4cplus 1.2.1-RC1 released

by Václav Haisman 2017-01-29

I have released log4cplus 1.2.1-RC1. It is a bugs fixing release.

  • Fixed GitHub bug #205. Fixed AsyncAppender shutdown crash.

  • Fixed GitHub bug #195. Check if queue thread pointer is not NULL and if it is running before trying to join it.

  • Fixed GitHub bug #136. Adjust weekly, daily and twice daily rollover time for DailyRollingFileAppender by time zone offset so that the rollover happens at midnight, etc., of local time instead of UTC time.

  • Fixed GitHub bug #148. TTCCLayout boolean members could be left uninitialized. Initialize them.

  • Fixed GitHub bug #163. Fixed Visual Studio 2015 build with CMake. Compilation fails not finding FreeAddrInfoW().

  • Disabled use of __thread on iOS.

  • Fixed SF#333. AsyncAppender's appenders need to be closed so that accumulated logs get flushed onto disk.

  • Updated android.toolchain.cmake from OpenCV project.

log4cplus 1.1.3-RC7 released

by Václav Haisman 2016-08-05

I have release log4cplus 1.1.3-RC7. It is a bugs fixing release:

  • Fixed SF#322. -- C++11 construct that should not be present.

  • Fixed FreeAddrInfoA and FreeAddrInfoW not found. -- This required bump to minimal version to Windows XP SP2.

  • Fixed missing thread's alternative name. -- GitHub bug #137.

  • Fixed GitHub bug #155. -- Process shutdown issues.

  • Fixed GitHub bug #136. -- Adjust weekly, daily and twice daily rollover time for DailyRollingFileAppender by time zone offset so that the rollover happens at midnight, etc., of local time instead of UTC time.

  • Fixed CMake/Visual Studio 2010 compilation. -- GitHub issue #188.

log4cplus 1.2.0 released

by Václav Haisman 2016-01-16

I have released log4cplus 1.2.0. The changes from the last release candidate are minimal:

  • Fixed SourceForge bug #324, MinGW compilation issue. Use InterlockedExchangeAdd instead of InterlockedAdd. The former is supported by older MinGW.

  • Fixed GitHub bug #137. Fix missing thread's alternative name.

log4cplus 1.2.0-RC6 released

by Václav Haisman 2016-01-02

I have released log4cplus 1.2.0-RC6:

  • Fixed Visual Studio build issue #322 related to WinSock functions being used and second about C++11 syntax. This forces minimum version of Windows supported by this release to Windows XP SP2.

  • Added DatePattern property to DailyRollingFileAppender configuration -- This property specifies filename suffix pattern to use for periodical backups of the logfile. (Alexey Morozov)

  • Added RollOnClose property to DailyRollingFileAppender and TimeBasedRollingFileAppender configuration -- This property specifies whether to rollover log files upon shutdown. By default it's set to true to retain compatibility with legacy code. (Alexey Morozov)

  • Normalized line endings, used .gitattributes to enforce it.

log4cplus 1.2.0-RC5 released

by Václav Haisman 2015-11-10

I have released log4cplus 1.2.0-RC5:

  • Various scripts and documentation cleanups.

  • Fix sockets and memory leak in loggingserver discussed in GitHub issue #112.

  • CMake improvements.

log4cplus 1.1.3-RC6 released

by Václav Haisman 2015-11-10

I have released log4cplus 1.1.3-RC6

  • Fixed GitHub issue #112 - sockets and memory leak in loggingserver.

log4cplus 1.2.0-RC4 released

by Václav Haisman 2015-08-02

I have released log4cplus 1.2.0-RC4.

  • Fixed init_priority GCC attribute detection and use issue.

  • Fixed "most vexing parse" issue with LOG4CPLUS_C_STR_TO_TSTRING(STRING) when STRING is an identifier.`

  • Fixed AcceptOnMatch property function in filters default to true value.

  • Fixed GitHub bug #92. DailyRollingFileAppender rollover time was drifting.

  • Fixed GitHub bug #86. Create directories for lock file if CreateDirs is specified.

  • Allow turning off library name decoration in CMake builds. See also GitHub issue #98.

log4cplus 1.1.3-RC5 released

by Václav Haisman 2015-08-02

I have released log4cplus 1.1.3-RC5:

  • Fixed "most vexing parse" issue when using LOG4CPLUS_C_STR_TO_TSTRING().

  • Fixed AcceptOnMatch property function in filters default to true value.

  • Fixed GitHub bug #92. DailyRollingFileAppender rollover time was drifting.

  • Added LOG4CPLUS_ENABLE_DECORATED_LIBRARY_NAME option to CMake builds to produce log4cplus library without Unicode and/or static library decoration.

log4cplus 1.1.3-RC4 released

by Václav Haisman 2015-01-04

I have released log4cplus 1.1.3-RC4:

  • Allow negative maximal length in pattern specifier to make trimming of end instead of beginning possible. E.g., allow %.-1p to get initial letters of log level.

  • Visual Studio DLL builds now have a resource with basic information about the library. (Oskari Timperi)

  • LOG4CPLUS_*_FMT() macros can now be invoked with just formatting string, without additional arguments. (Zhang Shengfa)

  • Added setCurrentThreadName() and setCurrentThreadName2() to allow setting current thread name to custom string instead of the default stringified thread ID. (Zhang Shengfa)

log4cplus 1.2.0-RC3 released

by Václav Haisman 2015-01-04

I have just released log4cplus 1.2.0-RC3:

  • Fixed various issues related to unspecified behaviors which manifested when log4cplus was compiled using Clang.

  • SysLogAppender now recognize SyslogHost property as synonym for host property.

  • Improved compatibility of TTCCLayout with log4j's. Added ThreadPrinting, CategoryPrefixing and ContextPrinting configuration properties.

  • Allow negative maximal length in pattern specifier to make trimming of end instead of beginning possible. E.g., allow %.-1p to get initial letters of log level.

  • New appender TimeBasedRollingFileAppender. (Alexander Malinin)

  • LOG4CPLUS_*_FMT() macros can now be invoked with just formatting string, without additional arguments. (Zhang Shengfa)

  • Insert to/from string/log level conversion functions to the beginning of vector to favour user defined log levels and conversion functions.

log4cplus 1.2.0-RC2 released

by Václav Haisman 2014-06-12

I have released log4cplus 1.2.0-RC2. It contains only a small amount of changes relative to the previous 1.2.0-RC1 release:

  • Fixed bug #298. -- int to pointer cast error on Xcode 5.1.

  • Updated android/android.toolchain.cmake.

  • Documented issue and work-around for Android's emutls issue.

  • Do not set SOVERSION and VERSION properties for CMake based Android builds.

log4cplus 1.2.0-RC1 released

by Václav Haisman 2014-03-19

I have released log4cplus 1.2.0-RC1. It is based on new 1.2.x branch. There are many visible and less visible changes relative to the code of 1.1.x branch. Here are some highlights:

  • TraceLogger and associated LOG4CPLUS_TRACE_*() macros now record function name in generated event.

  • Added Qt5 based Qt5DebugAppender.

  • Added prototype of Python bindings using Swig 2.0+.

  • Autotools based build system has been converted from Makefile per directory to single Makefile for the whole project mode.

  • Plain text documentation files have been converted to Markdown (with Pandoc's extensions).

  • FileAppender can now create missing directories in log file path, if this is enabled by CreateDirs property.

  • Added MSTTSAppender that uses Windows' text-to-speech engine.

  • SysLogAppender can now log into remote syslog instance using TCP in addition to previously supported UDP.

  • Added Autotest based testsuite running and verifying output of existing tests/ directory tests. Improved tests coverage.

  • Many other small and bigger improvements.

log4cplus 1.1.3-RC2 released

by Václav Haisman 2014-03-19

I have released log4cplus 1.1.3-RC2. It contains only few changes:

  • Fixed bug #295 - infinite loop when underlying *printf() function returned EILSEQ.

  • Use PROJECT_SOURCE_DIR variable instead of CMAKE_SOURCE_DIR to allow using log4cplus as sub-project of another CMake project.

source code hosting has moved to Github

by Václav Haisman 2014-01-14

I have decided to migrate log4cplus source code hosting to Git on Github. The repository is at https://github.com/log4cplus/log4cplus. Bug tracker, etc., stays on SourceForge.

Why? Bazaar development is pretty much dead and SourceForge is not supporting it any more. Log4cplus can survive a bit longer with Bazaar on Launchpad but there are other things to consider:

  • Git seems to have won the DVCS wars, at least for next few years. Migrations to Git seem to be happening quite a lot while migrations from Git seem to be rare.

  • Using main stream DVCS might make log4cplus hacking more attractive and/or accessible to drive by contributors. According to some blogs and posts on mailing lists, some people consider working with Bazaar hard and Bazaar lacking some features they know from Git and they consider having to learn yet another DVCS to contribute few small patches too much.

  • It seems that Emacs development is going to move to Git soon (or is even in the process of moving now). This is migration from Bazaar to Git. That such important OSS project has decided to move from Bazaar to Git has made me thinking about log4cplus hosting and Bazaar, again.

  • I have recently been using Git through Emacs and magit and it was not that bad experience. (I still hate the Git CLI.)

  • I have shortly entertained the idea of moving to Mercurial but I have quickly dismissed it. It seems it would just postpone move to Git only for few months or years at best. Again, Git seems to have won the DVCS wars.

  • I would like to use the Travis CI integration that Github offers, without having to run a mirroring script on my home box.

log4cplus 1.1.3-RC1 released

by Václav Haisman 2013-12-31

I have released log4cplus 1.1.3-RC1. There are mainly portability fixes related to MinGW, iOS, Android and CMake:

  • Added --enable-symbols-visibility-options to configure script to allow turning off use of compiler and platform specific symbols visibility options.

  • Added ENABLE_SYMBOLS_VISIBILITY setting for CMake build system to the same effect as above.

  • Disabled LOG4CPLUS_INLINES_ARE_EXPORTED to fix linking issues on MinGW GCC 4.8.x.

  • Added LOG4CPLUS_BUILD_LOGGINGSERVER setting for CMake build system to allow disabling loggingserver. (Maxym)

  • Allow users overriding LOG4CPLUS_MACRO_FUNCTION.

  • Improved Android platform detection in CMake build system. (Maxym)

  • Allow overriding ConfigureChecks.cmake with user supplied file to help with issues on iOS platform.

  • Updated android.toolchain.cmake from OpenCV project.

  • Added iOS support to CMake build system. (Maxym)

  • Fixed compilation issue of single-threaded builds on Windows.

  • Improved CMake build system's default installation directories for GNU platforms by using GNUInstallDirs module.

log4cplus 1.1.2 released

by Václav Haisman 2013-10-22

I have released log4cplus 1.1.2. There are only few changes since 1.1.2-RC3:

  • Added AbstractSocket::shutdown().
  • Added missing documentation of MDC pattern layout converter.
  • Fixed bug #278 - TLS key leak.
  • Implemented %E{ENVVAR} pattern layout formatter for expansion of environment variables.

log4cplus web pages have moved

by Václav Haisman 2013-09-30

I have moved the content of log4cplus.sourceforge.net web pages to log4cplus's wiki on SourceForge.

log4cplus 1.1.2-RC3 released

by Václav Haisman 2013-09-29

I have just released log4cplus 1.1.2-RC3. It contains mainly portability fixes:

  • Fixed build issues on HP-UX with aCC.
  • Fixed build issues on Haiku.
  • Added mingw-log4cplus.spec to allow cross-compilation from Fedora. (John Smits)
  • Fixed build issues on AIX with XLC.
  • Fixed build issues related to Microsoft's foo_s() functions with some version of MinGW tool-chain.
  • Tiny speedup of getFormattedTime().
  • Imported newer android/android.toolchain.cmake from OpenCV repository.

moving source code hosting to Launchpad.net

by Václav Haisman 2013-07-15

As SourceForge is not going to support Bazaar anymore, I have decided to move log4cplus source code hosting from SourceForge to Launchpad.net. I have decided to stick with Bazaar for some more time instead of moving to Github because it simply requires less effort than having to start using Git and Github. I am moving only the source code repository. Everything else (bug tracker, pages, etc.) stays on SourceForge.


Related

News: 2013/09/log4cplus-web-pages-have-moved
Wiki: BugReportingInstructions
Wiki: CodeExamples
Wiki: Development
Wiki: ProjectStatus
Wiki: README-1.1.3
Wiki: Release

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks