![banner] > **Manual For v9.96.7** [![Build Status (Master)](https://img.shields.io/travis/muflihun/easyloggingpp/master.svg)](#build-matrix) [![Build Status (Develop)](https://img.shields.io/travis/muflihun/easyloggingpp/develop.svg)](#build-matrix) [![Build status](https://ci.appveyor.com/api/projects/status/sfcgrehu8ypkrun3?svg=true)](https://ci.appveyor.com/project/abumusamq/easyloggingpp-node) [![Node Binding Version](https://img.shields.io/github/release/muflihun/easyloggingpp.svg)](https://github.com/muflihun/easyloggingpp/releases/latest) [![Version](https://img.shields.io/npm/v/easyloggingpp.svg)](https://www.npmjs.com/package/easyloggingpp) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/muflihun/easyloggingpp/blob/master/LICENCE) [![Downloads](https://img.shields.io/github/downloads/muflihun/easyloggingpp/total.svg)](https://github.com/muflihun/easyloggingpp/releases/latest) [![Donate](https://muflihun.github.io/donate.png?v2)](https://www.paypal.me/zuhd/25) ### Quick Links [![download] Latest Release](https://github.com/muflihun/easyloggingpp/releases/latest) [![notes] Changelog](/CHANGELOG.md) [![samples] Samples](/samples) --- ### Table of Contents
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
# 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.96.7. For other versions please refer to corresponding [release](https://github.com/muflihun/easyloggingpp/releases) on github. > You may also be interested in [Residue](https://github.com/muflihun/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/muflihun/easyloggingpp/issues/445). You can still use header-only in [v9.89](https://github.com/muflihun/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/muflihun/easyloggingpp/releases/latest) For other releases, please visit [releases page](https://github.com/muflihun/easyloggingpp/releases). If you application does not support C++11, please consider using [v8.91](https://github.com/muflihun/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 definiting 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