15 best C++ Logging Libraries
by Open Weaver kits ✔ Updated: Jan 25, 2023
Here is the list of best CPP logging libraries to help debug, understand the micro-level working of a program, track errors and status messages created during runtime, see the results of each independent process, and more.
Managing errors and exceptions in your C++ code is also challenging when running on the server side. The ability to track, analyse, and manage real-time errors can significantly improve your workflow and build high-quality code. Logging libraries let you do that.
- Multithreading/async writing to log files.
- Support of multiple log levels and types.
- Configuration and trace filtering from config file.
- Help of log rotation and time stamping.
- Singleton Class and thread safety in a multithreading environment.
- Good documentation and library support itself.
Check out our recommendation of the 15 best C++ Logging open-source libraries available for developers:
Single header C++ logging library. It is extremely powerful, extendable, light-weight, fast performing, thread and type safe and consists of many built-in features. It provides ability to write logs in your own customized format. It also provide support for logging your classes, third-party libraries, STL and third-party containers etc.
C++ 3352 Version:v9.97.0 License: Others (Non-SPDX)
Nanolog is an extremely performant nanosecond scale logging system for C++ that exposes a simple printf-like API.
C++ 2090 Version:0.91 License: Others (Non-SPDX)
Visual Python and C++ nanosecond profiler, logger, tests enabler
C++ 1943 Version:v0.6 License: Others (Non-SPDX)
Portable, simple and extensible C++ logging library
C++ 1708 Version:1.1.9 License: Permissive (MIT)
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.
C++ 1420 Version:REL_2_1_0 License: Others (Non-SPDX)
G3log is an asynchronous, "crash safe", logger that is easy to use with default logging sinks or you can add your own. G3log is made with plain C++14 (C++11 support up to release 1.3.2) with no external libraries (except gtest used for unit tests). G3log is made to be cross-platform, currently running on OSX, Windows and several Linux distros. See Readme below for details of usage.
C++ 811 Version:2.2 License: Permissive (Unlicense)
Reckless logging. Low-latency, high-throughput, asynchronous logging library for C++.
C++ 366 Version:v3.0.3 License: Others (Non-SPDX)
Log4z is an open source C++ lightweight & cross platform log library
C++ 319 Version:v3.4.0 License: Others (Non-SPDX)
A high performance C++ log library, producing structured binary logs
C++ 452 Version:2021-04-16 License: Permissive (Apache-2.0)
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
C++ 308 Version:v3.2.3 License: Others (Non-SPDX)
An efficient and configurable logging framework for C++
C++ 136 Version:3.1.1 License: Weak Copyleft (LGPL-3.0)