Label: asynchronous logging

This tag explores asynchronous logging from the perspective of architecture, performance, and production reliability.

Moving file output to a background thread can reduce latency on application threads, but it does not make logging free. Formatting, memory allocation, queue operations, synchronization, buffer management, worker wake-ups, batching, and physical file writes still consume CPU and system resources. In some workloads, asynchronous logging simply moves the bottleneck from the caller to the queue or file worker.

Articles in this section examine the complete logging path: from a C or C++ logging statement, through channels and routing, to backend queues and final file I/O. They discuss queue capacity, batching efficiency, dropped records, write errors, shutdown behavior, and the difference between messages accepted by a backend and bytes actually written to storage.

Another important topic is observability of the logging system itself. When a profiler shows a file backend among the hottest functions, developers need a way to determine which channels and source-code statements created the load. Disabling logging entirely may improve a benchmark, but it also removes the diagnostics required to investigate production failures.

The goal is to design asynchronous logging that remains fast, measurable, and dependable, while preserving enough information to diagnose real software problems.

FileBackend in Production: C++ Log Rotation with logme

Writing log messages to a file is easy. Keeping file logging predictable after months of production use is much harder. An active log file must not grow forever. Old logs need to be preserved for a useful period, but they also need to be deleted eventually. Finished files may need compression. At the same time,

Log Source Profiling: Which Log Statement Is Responsible?

How log source profiling traces CPU and file I/O back to individual C and C++ call sites without disabling production diagnostics Log source profiling starts where a normal CPU profiler stops. A system profiler can tell you that a logging thread is consuming CPU and show write(), a file-backend worker, queue synchronization, memory copies, and