mrkeyoor.com_
Sat 19 Sept 12:02 UTC
Dev Toolsevaluationupdated 26 Aug 2026

spdlog review

spdlog is a C++ logging library for writing formatted messages to consoles, files, system logs, debuggers, Qt widgets, or custom destinations. It solves the routine work of log levels, formatting, rotation, thread safety, and optional background delivery without forcing an application to adopt a larger observability system.

+17stars / 7d
Verdict

Our spdlog checkout built in 154 seconds and all 2 ctest targets passed in 22 seconds, making it the cleanest source run in this group. Use it as the default shortlist choice for ordinary C++ application logging, especially when console, rotating files, and custom sinks cover the job. Look elsewhere when async context propagation or a specific network timeout policy is mandatory, and remember that a logger is only the first stage of an observability pipeline.

We ran it

Lab card: what happened when we ran spdlogScreenshot of spdlog (github.com/gabime/spdlog)
Install✓ · 22s
Build✓ · 154s
Tests✓ · 22s2 passed · 0 failed of 2 (ctest)
Repo181 files~32,745 lines of source · 1.2 MB · 3 CI workflows · tests dir

Answers from our run

Does spdlog build from source?

Dependencies installed in 22 seconds, and the build succeeded in 154 seconds. We cloned commit f5f173a into a clean Debian container with 3 CPUs and no project-specific setup.

Do spdlog's tests pass?

Yes: 2 of 2 passed when we ran the project's own test command (ctest). Some failures need services or credentials a bare container does not have.

Who should not use spdlog?

Applications that require mapped diagnostic context in asynchronous logging: the README says MDC relies on thread-local storage and is unsupported in async mode.

What are the alternatives to spdlog?

Boost.Log, Quill, Loguru. Our spdlog checkout built in 154 seconds and all 2 ctest targets passed in 22 seconds, making it the cleanest source run in this group.

Setup5/5Small source, clean CMake build, package managers, and header-only option
Docs4/5Many runnable examples and a wiki, with some policies left to users
Community5/529,521 stars and current issue and pull-request discussion
Maturity5/5Stable v1 line, broad platform support, and a clean lab test run

Discussed on

  1. hnSpdlog: Super fast C++ logging library5 points

Who it’s for

C++ applications that need a familiar formatting API and several built-in log destinations.
Libraries that want either header-only integration or a compiled dependency to reduce build cost.
Multithreaded services needing separate synchronous or asynchronous loggers.
Desktop and systems developers targeting Linux, Windows, macOS, Android, or BSD platforms.
Teams prepared to define their own retention, flushing, and failure policies around each sink.

Who it’s NOT for

Applications that require mapped diagnostic context in asynchronous logging: the README says MDC relies on thread-local storage and is unsupported in async mode.
Services that cannot tolerate a long network-log connection stall: issue 2682 says tcp_client::connect() can wait up to 2 minutes and asks for a configurable timeout.
Users relying on daily-file retention across days with no logs: issue 2553 reports that a missing date can stop older files from being removed.
Builds that promote all deprecation warnings to errors while pairing spdlog 1.17.0 with external fmt 12.2.0: issue 3631 reproduces that combination on Visual Studio 2026.
Teams seeking a complete log collection, storage, search, and alerting service: spdlog writes events; you still operate what consumes them.

Setup reality

Our C++ sandbox install succeeded in 22 seconds. The CMake build succeeded in 154 seconds, and ctest finished in 22 seconds with 2 passed and 0 failed out of 2. The checkout was 1.2 MB with 181 files, so the source itself was compact.

The README gives two integration paths: copy the headers and use a C++11 compiler, or build the compiled library with CMake for shorter downstream compile times. Major system package managers also carry it. No credentials or external service are needed for console and file sinks.

Operational setup begins after linking. Pick single-threaded or multithreaded sinks, decide synchronous or asynchronous delivery, configure queue overflow and flush behavior, create writable log paths, and own rotation. Network, syslog, Windows event log, Qt, and custom sinks each add platform-specific availability or permissions.

spdlog covers the logging jobs most C++ programs actually need

The spdlog README starts with a compact API: call info, warn, or error with fmt-style placeholders. Under that simple surface are console colors, basic and rotating files, daily files, syslog, Windows event log, debugger output, Android, Qt widgets, callbacks, and custom sinks. Log levels can change at runtime or compile time. The library also has a backtrace ring buffer for retaining debug messages until an error makes them useful.

This breadth is practical rather than architectural. A desktop application can write warnings to the console and full details to a file through one multi-sink logger. A service can choose an asynchronous file logger. A library can accept a logger supplied by its host. The API does not require a daemon, account, configuration server, or network connection. At 181 repository files and 1.2 MB checked out in our run, the project stays small enough to audit and vendor.

Header-only and compiled modes trade convenience for compile time

The header-only path asks users to copy the include directory and compile with C++11 or newer. That is convenient for a prototype or vendored dependency because there is no separate library artifact to ship. The README recommends the compiled path for much faster compilation. CMake builds that library normally, and packages are available through Debian, Homebrew, Fedora, vcpkg, Conan, conda, and other common native ecosystems.

Formatting comes from fmt, which spdlog can bundle or consume externally. Version 1.17.0 updated the bundled fmt copy to 12.1.0. Mixing a newer external fmt deserves a build check: issue 3631 reports deprecation warnings with fmt 12.2.0 and Visual Studio 2026, which become failures when warnings are treated as errors. Pin both dependencies together in strict builds.

What happened when we ran it

Our sandbox installed commit f5f173a in 22 seconds. The CMake build then completed in 154 seconds in a fresh unprivileged container with 3 CPUs and 8 GB of RAM. Unlike the larger agent projects in this batch, spdlog needed no service credentials, package registry login, database, or model provider to reach a built artifact. The repository included 3 CI workflow files and a dedicated tests directory.

Ctest finished in 22 seconds with 2 passing and 0 failing tests. Those are the only test-count and timing claims from our run; we did not measure message throughput or compare sink latency. The README publishes its own benchmark section on older named hardware, but that is not a substitute for testing your message size, thread count, filesystem, flush policy, and compiler flags. Logging cost is shaped by all five.

The clean result gives confidence in the documented CMake route. It does not validate every optional platform sink or async overflow choice. Our Debian container could not stand in for Windows event log, Android logcat, Qt widgets, or an unreachable TCP endpoint. Teams using those paths should add a focused smoke test on each shipping platform rather than treating the 2 ctest targets as universal coverage.

Async mode makes queue policy part of correctness

An asynchronous logger moves formatting and sink work through a shared thread pool. The README shows queue sizing, backing threads, and two overflow policies: block the caller or overrun older messages. Neither policy is universally safe. Blocking can let an unavailable destination stall application work. Overrunning can discard the exact events needed during an incident. Pick deliberately, expose dropped-message signals where possible, and test shutdown so buffered records reach their destination.

Mapped Diagnostic Context has a specific limit. The README says it is thread-local and unsupported in asynchronous mode. Applications that depend on request IDs, tenant IDs, or trace fields should avoid assuming MDC will cross that boundary. Pass fields in the message, build a custom representation, or choose a library whose async design preserves the context model you need. This is a competent-developer reason to reject spdlog for some services.

Rotation and network sinks need application-level tests

Rotating and daily file sinks reduce housekeeping code, yet retention is still part of production correctness. Issue 2553 reports that daily cleanup stops scanning at the first missing date, leaving older files behind when a day has no log file. A proposed pull request scans the directory instead, but the issue remained open when researched. Disk-budget tests should include gaps, restarts, clock changes, and manual deletion.

A network destination has a different failure mode. Issue 2682 says the TCP client can wait up to 2 minutes when a syslog server is unreachable and asks for a configurable connect timeout. That duration comes from the issue report, not our lab. A process with a strict startup or request deadline should isolate connection attempts or choose a sink with the required timeout control.

The v1 branch is maintained, even with a slower release rhythm

The latest tagged release, 1.17.0, shipped on 2026-01-04. The repository was pushed on 2026-08-08, and issues and pull requests were still receiving updates later in August. Its 50 open issues and pull requests form a modest combined queue for a 29,521-star library. The January tag alone does not indicate abandonment; current code and discussion show continued maintenance on the v1.x default branch.

The source is under the MIT license, with a notice that fmt carries its own MIT terms. Boost.Log is the alternative for a richer Boost-native attribute system, Quill for an async-first design, and Loguru for a smaller inclusion model. spdlog is the sensible first pick when common sinks and readable fmt syntax matter more than elaborate event schemas. Its clean build and test run reinforce that recommendation.

Alternatives

ProjectWhat it isPick it when
Boost.LogBoost's logging library with attributes, filters, formatters, sinks, and deeper integration into the Boost ecosystem.pick this instead when your application already depends on Boost and needs its richer attribute and filter model.
QuillA C++ logging library centered on low-latency asynchronous delivery.pick this instead when asynchronous logging architecture is the first requirement and you are willing to compare its queue and failure behavior.
LoguruA small C++ logging library designed for straightforward single-file inclusion.pick this instead when you want a smaller API and fewer sink types for a modest native application.

What people are saying

  1. [github-trending] gabime/spdlog

Sources

  1. spdlog README
  2. spdlog 1.17.0 release
  3. spdlog MIT license
  4. Daily rotation cleanup issue 2553
  5. TCP connect timeout issue 2682
  6. fmt 12.2.0 warning issue 3631

More dev tools reviews

python-patterns · opcode · mdBook · lore · OhMyKeymint · tty7 · the whole board →