DEV.co
Open-Source Observability · KjellKod

g3log

g3log is a lightweight, asynchronous C++ logging library designed for performance-critical applications. It provides crash-safe logging with minimal overhead (~2 microseconds per call), design-by-contract checks, and graceful handling of fatal signals without losing log data.

Source: GitHub — github.com/KjellKod/g3log
960
GitHub stars
280
Forks
C++
Primary language
Unlicense
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
RepositoryKjellKod/g3log
OwnerKjellKod
Primary languageC++
LicenseUnlicense — OSI-approved
Stars960
Forks280
Open issues4
Latest release2.6 (2025-06-10)
Last updated2026-07-01
Sourcehttps://github.com/KjellKod/g3log

What g3log is

An asynchronous, signal-aware logger written in C++14 with no external runtime dependencies. Features include streaming and printf-style APIs, fatal crash handling with stack trace support, custom logging levels, and pluggable sinks. Designed for low and stable worst-case latency in high-throughput scenarios.

Quickstart

Get the g3log source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/KjellKod/g3log.gitcd g3log# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

High-frequency trading, real-time systems, and embedded applications

Where predictable latency and minimal logging overhead are critical. g3log's ~2 microsecond average overhead and stable worst-case latency make it suitable for systems that cannot tolerate jitter from logging.

Mission-critical services requiring crash diagnostics

Applications that need to preserve all log entries up to a fatal event, including stack traces. g3log flushes pending logs before allowing the process to exit on SIGABRT, SIGSEGV, and other fatal signals.

Cross-platform C++ codebases with minimal dependencies

Projects targeting Windows, macOS, and Linux that need a single logging solution without third-party runtime dependencies (unit tests use gtest, but that is not a production dependency).

Implementation considerations

  • C++14 compiler required (C++11 supported only up to release 1.3.2); verify toolchain compatibility before adoption.
  • Async design means log calls are non-blocking but order is guaranteed; application must manage worker thread lifecycle and shutdown sequencing.
  • Fatal signal handlers are installed globally; test interaction with other signal handlers in your codebase.
  • Custom sinks can be plugged in; default sink has no external dependencies, but third-party sinks (e.g., Syslog) require additional configuration.
  • Log rotation and filtering are available through separate g3sinks project; evaluate whether baseline functionality or extended sinks are needed.

When to avoid it — and what to weigh

  • Require managed language ecosystems (Java, Python, Go, Rust) — g3log is C++14-only. No native bindings or wrappers are mentioned in the data provided.
  • Need enterprise support, SLA, or vendor backing — This is a community-maintained open-source project. Support is best-effort; no commercial support entity is documented.
  • Require centralized log aggregation out-of-the-box — g3log writes to local sinks by default. Forwarding to remote systems (Syslog, etc.) is available via separate g3sinks project, requiring additional setup.
  • Working on Windows-only with visual studio toolchains requiring MSVC specifics — While Windows is supported, integration details and toolchain-specific configuration are not clearly stated in the provided data.

License & commercial use

The Unlicense: g3log is released into the public domain. No attribution is required, and the software can be used for any purpose, including commercial, without restriction or warranty.

The Unlicense is a clear public-domain dedication, permitting unrestricted commercial use. However, because there is no warranty or liability provision, and no vendor support is documented, organizations should assess risk tolerance for a community-maintained library in critical systems. Standard due diligence (code review, testing) recommended before production deployment.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

No explicit security audit data provided. Signal handling for fatal events (SIGABRT, SIGSEGV, SIGTERM, etc.) is implemented; review interaction with any custom signal handlers. Stack trace generation relies on symbol availability (requires debug symbols); ensure security of logged stack traces if they contain sensitive memory patterns. No mention of log sanitization or scrubbing for PII; sanitization must be handled by application logic or custom sinks. CodeQL scanning is enabled, reducing (but not eliminating) risk of common C++ vulnerabilities.

Alternatives to consider

spdlog

Modern C++17 header-only logging library with better formatting, more sinks out-of-the-box, and wider adoption. Trade-off: higher memory footprint and slightly higher overhead than g3log; fewer embedded/real-time deployments.

Boost.Log

Comprehensive, feature-rich logging framework from Boost. Trade-off: heavyweight dependency, steeper learning curve, and slower than g3log. Better for complex enterprise logging pipelines.

nanolog

Extremely low-latency logging using compile-time formatting and ring buffers. Trade-off: less flexible than g3log, specialized use case (HFT/ultra-low-latency), smaller community.

Software development agency

Build on g3log with DEV.co software developers

Evaluate g3log's fit for your architecture: review the API documentation, run performance benchmarks in your environment, and assess signal handler interactions with your codebase. For enterprise support or custom sink development, consider Devco's custom software services.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

g3log FAQ

Is g3log suitable for production use?
Yes, for appropriate use cases (real-time systems, crash-safe logging, embedded platforms). However, it is community-maintained without vendor SLA. Code review and testing in your environment are recommended before production deployment.
Does g3log support remote logging (cloud, Syslog)?
Not directly in the core library. The separate g3sinks project provides Syslog and colored terminal output sinks. Remote aggregation requires custom sink implementation or integration with g3sinks.
What is the typical logging latency?
Average ~2 microseconds per call on typical 2010-era hardware (per README). Async design with stable worst-case latency makes it suitable for latency-sensitive workloads. Performance varies by platform; benchmarking in your environment is advised.
Can I use g3log in Windows/MSVC projects?
Yes, Windows is explicitly listed as a supported platform. Build details and toolchain-specific configuration are in docs/building.md. Exact MSVC version support and toolchain-specific concerns are not detailed in the provided data; verify in docs.

Software development & web development with DEV.co

Adopting g3log is usually one piece of a larger software development effort. As a software development agency, DEV.co provides software development services and web development expertise — pairing senior software developers and web developers with your team to design, build, and operate open-source observability software in production.

Ready to integrate high-performance logging into your C++ application?

Evaluate g3log's fit for your architecture: review the API documentation, run performance benchmarks in your environment, and assess signal handler interactions with your codebase. For enterprise support or custom sink development, consider Devco's custom software services.