Repolode
gabime

gabime/spdlog

Fast C++ logging library with formatted output, async mode, and multiple sinks such as rotating files, console, and syslog.

Stars
29,703
Forks
5,341
Open issues
58
Last commit
18 hours ago

What is it?

spdlog is a C++ logging library that lets applications write formatted log messages to a range of destinations. It can be used as a header-only library or compiled with CMake, and it uses the fmt library for message formatting.

Loggers can write to rotating files, daily files, colored console output, syslog, the Windows event log, the Windows debugger, and Qt widgets. Log levels can be changed at runtime or at compile time, and they can be loaded from command-line arguments or environment variables. An optional asynchronous mode moves output work to a background thread pool, and a backtrace buffer keeps recent debug messages so they can be dumped when an error occurs.

The library supports Linux, BSD variants, Solaris, AIX, Windows, macOS, and Android, and it is available from many common package managers.

Key features

  • 01Header-only or compiled usage with CMake
  • 02Formatted messages powered by fmt, including custom patterns and user-defined types
  • 03Rotating, daily, console, syslog, and Windows event log sinks
  • 04Asynchronous logging with a background thread pool
  • 05Runtime and compile-time log level control, loadable from env vars or argv
  • 06Backtrace buffer for dumping recent debug messages on demand

Use cases

  • Adding structured, leveled logging to a C++ server or desktop application
  • Writing logs to rotating files on long-running services
  • Sending high-volume logs through an async logger to limit impact on request threads
  • Routing logs to syslog or the Windows event log in system services

Quick start

  1. 1

    Clone the repository

    git clone https://github.com/gabime/spdlog.git
  2. 2

    Enter the directory and create a build folder

    cd spdlog && mkdir build && cd build
  3. 3

    Configure and build with CMake

    cmake .. && cmake --build .

Things to know

  • The license is not clearly identified in the metadata, so check the repository's license file before use.

In collections

Topics

FAQ

What is spdlog?
Fast C++ logging library with formatted output, async mode, and multiple sinks such as rotating files, console, and syslog. spdlog is a C++ logging library that lets applications write formatted log messages to a range of destinations. It can be used as a header-only library or compiled with CMake, and it uses the fmt library for message formatting.
Is spdlog free to use? What license does it have?
spdlog is open source under the Other license. Check the license terms before using it in commercial products.
Is spdlog still maintained?
Actively maintained. The last commit to spdlog was on Oct 24, 2026.
What can I use spdlog for?
Adding structured, leveled logging to a C++ server or desktop application Writing logs to rotating files on long-running services Sending high-volume logs through an async logger to limit impact on request threads Routing logs to syslog or the Windows event log in system services
How do I install spdlog?
Clone the repository: git clone https://github.com/gabime/spdlog.git Enter the directory and create a build folder: cd spdlog && mkdir build && cd build Configure and build with CMake: cmake .. && cmake --build .
Where can I get spdlog?
The source code and installation instructions are on GitHub: https://github.com/gabime/spdlog

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects