|
Logger System 1.0.0
High-performance C++20 thread-safe logging system with asynchronous capabilities
|
doc_id: "LOG-GUID-029" doc_title: "Logger System Troubleshooting Guide" doc_version: "1.0.0" doc_date: "2026-04-18" doc_status: "Released" project: "logger_system"
SSOT: This document is the single source of truth for Logger System Troubleshooting Guide.
Language: English
Quick reference for diagnosing common build, configuration, and runtime issues in logger_system. For general usage questions, see the FAQ; for build options, see the Build Guide.
common_system not foundSymptom:
Cause: common_system was not cloned next to logger_system, or it was not built/installed.
Fix:
See Build Guide - Source Layout.
Symptom (GCC/Clang):
Cause: Compiler does not meet the C++20 baseline (GCC 11+, Clang 14+, Apple Clang 14+, MSVC 2022+).
Fix: Upgrade the compiler, or switch to a compatible preset:
Symptom:
Cause: LOGGER_USE_ENCRYPTION=ON (the default) but OpenSSL is not installed.
Fix (either install OpenSSL or disable encryption):
opentelemetry-cpp not foundSymptom:
Cause: LOGGER_ENABLE_OTLP=ON but opentelemetry-cpp 1.14+ is not available.
Fix: Install via vcpkg (vcpkg install opentelemetry-cpp) or disable OTLP:
Symptom (CMake 3.27 or older):
Fix: Either upgrade CMake and use a modules-capable compiler (Clang 16+ / GCC 14+), or disable modules:
The header-based interface is the supported primary API.
kcenon::logger::logger_builderSymptom:
Cause: Application does not link the logger library, or links it before its own object files (order matters on some GNU linkers).
Fix:
Place the logger target after the consuming target in the link line.
Cause: Both a system-installed and a FetchContent-built copy of logger_system are linked into the same binary.
Fix: Choose one source. If using FetchContent, remove the system install from CMAKE_PREFIX_PATH.
Cause: Encryption is enabled but OpenSSL libraries are not in the link line (can happen with custom toolchains that bypass CMake).
Fix: Ensure find_package(OpenSSL REQUIRED) succeeds and link OpenSSL::SSL OpenSSL::Crypto, or disable LOGGER_USE_ENCRYPTION.
logger_builder::build() returns an errorCheck the Result before using it:
Common causes:
Possible causes:
LOGGER_ENABLE_CRASH_HANDLER=ON, default) or use the crash_safe writer variant.flush() is called before the process exits.Async writer queue is full and the configured policy drops messages.
Fix (pick one):
See Performance Guide.
Typical cause: static-destruction order between the logger and a writer's owned resources.
Fix: Destroy the logger explicitly before main returns, or hold it in a local std::unique_ptr.
| Symptom | Likely Cause | Fix |
|---|---|---|
High latency per log() call | Synchronous writer | Use async writer chain |
| Throughput plateaus early | Small queue / batch size | Increase LOGGER_DEFAULT_QUEUE_SIZE, LOGGER_DEFAULT_BATCH_SIZE |
| High CPU with few logs | Formatter running on hot path | Defer formatting to async writer |
| Sporadic latency spikes | File rotation mid-flush | Pre-size log files, reduce rotation frequency |
See Performance Guide and Benchmarks.
thread_system pool not usedEnsure both the build option and runtime wiring are in place:
See Integration Guide for constructor wiring.
See OpenTelemetry Guide.
Tests and benchmarks are disabled on MinGW; the library itself builds. Use a Windows MSVC build for test coverage.
std::format unavailableApple Clang 14 has partial C++20 support. If std::format is not found, upgrade Xcode command-line tools, or build with clang++ from Homebrew.
dll not found at runtimeWhen building shared OpenSSL, ensure the DLLs are on PATH or co-located with the executable.