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] # ARCHIVE NOTICE > ⚠️ 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. ## Thank You To everyone who: - Contributed pull requests - Reported issues - Wrote benchmarks—some comparing limited setups (e.g., without enabling asynchronous logging or multithreading, like [Issue #73 on KjellKod/g3log](https://github.com/KjellKod/g3log/issues/73)) and others using full feature sets - Shared feedback and real-world use cases Your involvement gave this project purpose and direction. ## Now Archived: Consider `spdlog` for New Projects While Easylogging++ is still a **fully-featured**, **single-header** C++ logging library, I recommend using [**spdlog**](https://github.com/gabime/spdlog) or other actively maintained logging libraries for new projects. These libraries continue to evolve and offer better integration, performance, and community support. ## No Longer Maintained 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. ## Grateful and Humble 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](https://github.com/abumq))* --- > **Documentation for v9.97.1** ### Quick Links → [Latest Release](https://github.com/abumq/easyloggingpp/releases/latest) → [Changelog](/CHANGELOG.md) → [Samples](/samples) --- ### Table of ContentsOverview 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# Overview 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_](/samples/send-to-network) (via featured referred as `LogDispatchCallback`). This library is currently used by [hundreds of open-source projects on github](https://github.com/search?q=%22easylogging%2B%2B.h%22&type=Code&utf8=%E2%9C%93) and other open-source source control management sites. This manual is for Easylogging++ v9.97.1. For other versions please refer to corresponding [release](https://github.com/abumq/easyloggingpp/releases) on github. > You may also be interested in [Residue](https://github.com/abumq/residue/) logging server. [![top] Goto Top](#table-of-contents) ### Why yet another library 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](https://github.com/abumq/easyloggingpp/issues/445). You can still use header-only in [v9.89](https://github.com/abumq/easyloggingpp/releases/tag/9.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. [![top] Goto Top](#table-of-contents) ### Features at a glance Easylogging++ is feature-rich containing many features that both typical and advanced developer will require while writing a software; * [Highly configurable](#configuration) * [Extendable](#extending-library) * Extremely fast * [Thread](#multi-threading) and type safe * [Cross-platform](#compatibility) * [Custom log patterns](#logging-format-specifiers) * [Conditional and occasional logging](#conditional-logging) * [Performance tracking](#performance-tracking) * [Verbose logging](#verbose-logging) * [Crash handling](#crash-handling) * [Helper CHECK macros](#check-macros) * [STL logging](#stl-logging) * [Send to Syslog](#syslog) * [Third-party library logging (Qt, boost, wxWidgets etc)](#logging-third-party-class) * [Extensible (Logging your own class or third-party class)](#logging-your-own-class) * [And many more...](#extra-features) [![top] Goto Top](#table-of-contents) # Getting Started ### Download Download latest version from [Latest Release](https://github.com/abumq/easyloggingpp/releases/latest) For other releases, please visit [releases page](https://github.com/abumq/easyloggingpp/releases). If you application does not support C++11, please consider using [v8.91](https://github.com/abumq/easyloggingpp/tree/v8.91). This is stable version for C++98 and C++03, just lack some features. [![top] Goto Top](#table-of-contents) ### Quick Start In order to get started with Easylogging++, you can follow three easy steps: * Download latest version * Include into your project (`easylogging++.h` and `easylogging++.cc`) * Initialize using single macro... and off you go! ```c++ #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++11 ``` That 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. ### Install (Optional) 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 install ``` Following options are supported by Easylogging++ cmake and you can turn these options on using `-D
No open issues yet, or sync has not completed.