C++ logging library. It is powerful, supports asynchronous low latency, extendable, light-weight, fast performing, thread and type safe and consists of many bui
C++ logging library. It is powerful, supports asynchronous low latency, extendable, light-weight, fast performing, thread and type safe and consists of many bui
﷽
![banner]
⚠️ This project is archived and no longer actively maintained.
Easylogging++ has been a labor of love from 2012 to 2018, and it’s been incredible to see the community embrace it. From embedded systems to desktop applications, this little library made its way into countless projects—many thanks to you, the developers, contributors, and users who helped shape it over the years.
To everyone who:
Your involvement gave this project purpose and direction.
spdlog for New ProjectsWhile Easylogging++ is still a fully-featured, single-header C++ logging library, I recommend using spdlog or other actively maintained logging libraries for new projects. These libraries continue to evolve and offer better integration, performance, and community support.
Due to other commitments and active projects, I will not be making changes or accepting pull requests going forward.
However, Easylogging++ remains under the permissive MIT License. You are welcome—and encouraged—to fork, customize, or evolve the library as you see fit. This was the exact reason I chose MIT: to empower developers like you with maximum freedom.
It’s been a wonderful ride, and I’m truly humbled by the response this project received. If you’ve used Easylogging++ or learned something from it—thank you.
Feel free to follow my GitHub to stay in the loop with the other projects I’m working on.
Stay curious, keep building.
— Majid Q. (@abumq)
Documentation for v9.97.1
→ Samples
Overview
Why yet another library
Features at a glance
Getting Started
Download
Quick Start
Install (Optional)
Setting Application Arguments
Configuration
Level
Configure
Using Configuration File
Using el::Configurations Class
Using In line Configurations
Default Configurations
Global Configurations
Logging Format Specifiers
Date/Time Format Specifiers
Custom Format Specifiers
Logging Flags
Application Arguments
Configuration Macros
Reading Configurations
Logging
Basic
Conditional Logging
Occasional Logging
printf Like Logging
Network Logging
Verbose Logging
Basic
Conditional and Occasional
Verbose Level
Check If Verbose Logging Is On
VModule
Registering New Loggers
Unregister Loggers
Populating Existing Logger IDs
Sharing Logging Repository
Extra Features
Performance Tracking
Conditional Performance Tracking
Make Use of Performance Tracking Data
Log File Rotating
Crash Handling
Installing Custom Crash Handlers
Stacktrace
Multi-threading
CHECK Macros
Logging perror()
Using Syslog
STL Logging
Supported Templates
Qt Logging
Boost Logging
wxWidgets Logging
Extending Library
Logging Your Own Class
Logging Third-party Class
Manually Flushing and Rolling Log Files
Log Dispatch Callback
Logger Registration Callback
Asynchronous Logging
Helper Classes
Contribution
Submitting Patches
Reporting a Bug
Compatibility
Build Matrix
Licence
Disclaimer
Easylogging++ is single header efficient logging library for C++ applications. It is extremely powerful, highly extendable and configurable to user's requirements. It provides ability to write your own sinks (via featured referred as LogDispatchCallback). This library is currently used by hundreds of open-source projects on github and other open-source source control management sites.
This manual is for Easylogging++ v9.97.1. For other versions please refer to corresponding release on github.
You may also be interested in Residue logging server.
If you are working on a small utility or large project in C++, this library can be handy. Its based on single header and only requires to link to single source file. (Originally it was header-only and was changed to use source file in issue #445. You can still use header-only in v9.89).
This library has been designed with various thoughts in mind (i.e, portability, performance, usability, features and easy to setup).
Why yet another library? Well, answer is pretty straight forward, use it as you wrote it so you can fix issues (if any) as you go or raise them on github. In addition to that, I personally have not seen any logging library based on single-header with such a design where you can configure on the go, extend it to your needs and get fast performance. I have seen other single-header logging libraries for C++ but either they use external libraries, e.g, boost or Qt to support certain features like threading, regular expression or date etc. This library has everything built-in to prevent usage of external libraries, not that I don't like those libraries, in fact I love them, but because not all projects use these libraries, I couldn't take risk of depending on them.
Easylogging++ is feature-rich containing many features that both typical and advanced developer will require while writing a software;
Download latest version from Latest Release
For other releases, please visit releases page. If you application does not support C++11, please consider using v8.91. This is stable version for C++98 and C++03, just lack some features.
In order to get started with Easylogging++, you can follow three easy steps:
easylogging++.h and easylogging++.cc)#include "easylogging++.h"
INITIALIZE_EASYLOGGINGPP
int main(int argc, char* argv[]) {
LOG(INFO) << "My first info log using default logger";
return 0;
}Now compile using
g++ main.cc easylogging++.cc -o prog -std=c++11That simple! Please note that INITIALIZE_EASYLOGGINGPP should be used once and once-only otherwise you will end up getting compilation errors. This is the definition of several extern variables. This means it can be defined only once per application. Best place to put this initialization statement is in file where int main(int, char**) function is defined, right after last include statement.
If you want to install this header system-wide, you can do so via:
mkdir build
cd build
cmake -Dtest=ON ../
make
make test
make installFollowing options are supported by Easylogging++ cmake and you can turn these options on using -D<option>=ON
lib_utc_datetime - Defines ELPP_UTC_DATETIMEbuild_static_lib - Builds static library for Easylogging++With that said, you will still need easylogging++.cc file in order to compile. For header only, please check v9.89 and lower.
Alternatively, you can download and install easyloggingpp using the vcpkg dependency manager:
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install easyloggingppThe easyloggingpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.
It is al
No open issues yet, or sync has not completed.