Menu

Tree [5ce81a] master REL_1.1.6_Mar_12_2026 /
 History

HTTPS access


File Date Author Commit
 cmake 2026-02-10 Alexander Perepelkin Alexander Perepelkin [5b1d56] Emulate autotools behaviour and generate includ...
 config 2025-10-29 Alexander Perepelkin Alexander Perepelkin [99bf32] autoreconf -fi -I m4
 doc 2026-02-27 Alexander Perepelkin Alexander Perepelkin [f79a7d] index.html
 examples 2026-02-12 Alexander Perepelkin Alexander Perepelkin [a97cc1] Utilize macros LOG4CPP_PACKAGE_NAME, LOG4CPP_PA...
 include 2026-02-21 Alexander Perepelkin Alexander Perepelkin [0e3628] Keep project version-related macros for hardcod...
 m4 2023-02-07 Alexander Perepelkin Alexander Perepelkin [6448ec] Patch #49 C99 compatibility fix for snprintf co...
 projects 2026-02-24 Alexander Perepelkin Alexander Perepelkin [16d6a0] Prevent MS VS from mixing old project files wit...
 src 2026-02-20 Alexander Perepelkin Alexander Perepelkin [a4740e] clang-format setting 'SpacesInAngles: Never' b...
 tests 2026-02-27 Alexander Perepelkin Alexander Perepelkin [7ff8d5] fix cmake examples build
 .clang-format 2025-12-01 Alexander Perepelkin Alexander Perepelkin [7eea25] .clang-format, BasedOnStyle: LLVM, with only mi...
 .cvsignore 2008-11-28 darkangel darkangel [8b523f] Added simple test for RollingFileAppender. Rewr...
 .gitattributes 2026-01-20 Alexander Perepelkin Alexander Perepelkin [4d87c3] Exclude documentation and configuration from Gi...
 .gitignore 2026-02-20 Alexander Perepelkin Alexander Perepelkin [cf79f3] .gitignore
 AUTHORS 2025-11-13 Alexander Perepelkin Alexander Perepelkin [d91a7d] index.html, AUTHORS
 CMakeLists.txt 2026-02-11 Alexander Perepelkin Alexander Perepelkin [95bb9c] CMake: add test build support using CTest
 COPYING 2001-02-15 Bastiaan Bakker Bastiaan Bakker [aedd65] Incremented version to 0.2.1. Changed license t...
 ChangeLog 2026-02-27 Alexander Perepelkin Alexander Perepelkin [349b0d] index.html wording
 INSTALL 2025-10-29 Alexander Perepelkin Alexander Perepelkin [99bf32] autoreconf -fi -I m4
 Makefile.am 2026-02-27 Alexander Perepelkin Alexander Perepelkin [5ce81a] Remove references to directories msvc6 bcb5 ope...
 NEWS 2002-08-05 Bastiaan Bakker Bastiaan Bakker [77aa47] Documentation updates.
 README.md 2026-02-27 Alexander Perepelkin Alexander Perepelkin [01f1d3] README.md for githib
 THANKS 2026-02-12 Alexander Perepelkin Alexander Perepelkin [09f5cc] Update and fix THANKS, leave ascii content
 TODO 2001-12-11 Bastiaan Bakker Bastiaan Bakker [1734a2] Mark PatternLayout and SimpleConfigurator as done.
 autogen.sh 2025-11-07 Alexander Perepelkin Alexander Perepelkin [e51295] Stop executing ./autogen.sh if any error happens
 configure.in 2026-02-27 Alexander Perepelkin Alexander Perepelkin [5ce81a] Remove references to directories msvc6 bcb5 ope...
 jamfile 2007-07-05 darkangel darkangel [3642d0] Added Boost.Build build files.
 log4cpp-config.in 2004-01-27 Bastiaan Bakker Bastiaan Bakker [58fdf1] use ac_config_libconfig_in macro.
 log4cpp.cfg 2002-06-17 Aaron Ingram Aaron Ingram [8b74bf] added a sample configuration file for SimpleCon...
 log4cpp.m4 2005-03-24 Bastiaan Bakker Bastiaan Bakker [32d959] fixed 'underquoted definition' warning
 log4cpp.pc.in 2004-01-27 Bastiaan Bakker Bastiaan Bakker [58fdf1] use ac_config_libconfig_in macro.
 log4cpp.spec.in 2007-08-25 darkangel darkangel [66f7e6] Scott Cantor Solaris 10 fixes

Read Me

log4cpp

Build latest master with CMake, run Ctest on Linux, Windows, MacOS

Log4cpp is library of C++ classes for flexible logging to files, syslog, IDSA and other destinations. It is modeled
after the Log4j Java library, staying as close to their API as is reasonable.

Features

  • Multiple log levels (DEBUG, INFO, WARN, ERROR, FATAL, ...)
  • Thread-safe logging
  • Customizable log format
  • Console and file appenders, including:
    • Size-based rolling files
    • Daily rolling files
    • Syslog
    • IDSA
    • SMTP
    • Windows Event Log
  • No external dependencies
  • Cross-platform (Linux, macOS, Windows)
  • Build support with Autotools, CMake

Installation

Download source code

Option 1 - Download a Release from SourceForge

Choose the latest stable version or a recent release candidate.

Option 2 - Clone the Git Repository SourceForge or GitHub

Get the latest version of the source code:

git clone https://github.com/log4cpp/log4cpp.git

Build with Autotools

./autogen.sh  # optional
./configure
make
make check
make install

Build with CMake

cmake -S . -B build_release -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME/.local -DLOG4CPP_BUILD_EXAMPLES=ON
cmake --build build_release
cd build_release/tests; ctest
cd ../..; cmake --install build_release

Other Build Methods

Additional build methods are listed on the project website (http://log4cpp.sf.net/).

Using in your CMake project

CMake usage examples are provided for two scenarios:

Building examples is enabled via the LOG4CPP_BUILD_EXAMPLES configuration option (-DLOG4CPP_BUILD_EXAMPLES=ON).
Both shared and static library variants are demonstrated.
The CMake usage examples can be built either:

  • as part of the log4cpp build (when LOG4CPP_BUILD_EXAMPLES is enabled), or
  • as standalone CMake applications that import or include log4cpp from their own directories. To build an example as a
    standalone application, change into the example directory and build it separately with CMake.
    sh cd examples/cmake_usages/log4cpp_as_subproject cmake -S . -B build cmake --build build
    sh cd examples/cmake_usages/log4cpp_as_package cmake -S . -B build -DCMAKE_PREFIX_PATH=$HOME/.local # possible after log4cpp was installed with CMake cmake --build build
MongoDB Logo MongoDB