-
Notifications
You must be signed in to change notification settings - Fork 3
Backend RingBuffer
RingBufferBackend is an in-memory backend that keeps only the last N formatted records.
It is intended for diagnostics, tests, and recent-history capture where keeping the complete log stream is unnecessary.
Implementation behavior:
- each accepted record is formatted using the owner channel’s
OutputFlags - records are stored as strings
- appending is protected by an internal mutex
- when the record count exceeds
max-items, the oldest records are removed -
Join()returns the current ring content as one string -
Clear()drops the current records
RingBufferBackendConfig::Parse() supports:
-
max-items— positive integer number of records to keep
Example:
{
"type": "RingBufferBackend",
"max-items": 200
}max-items must be greater than zero.
The backend command accepts the type names ringbuffer, ring, and rbuf:
logmectl -p 9010 backend --channel net --add ring --max-items 200--max-items applies only to RingBufferBackend.
BufferBackend and RingBufferBackend are both memory backends, but they solve different problems:
-
BufferBackendstores a byte buffer and is useful for delayed persistence or complete in-memory capture. -
RingBufferBackendstores the last N records and is useful for recent-history diagnostics.
See Recent-History Capture for the diagnostic pattern built on top of this backend.
logme — flexible runtime logging system
Home · Getting Started · Architecture · Output · Backends · Configuration
GitHub: https://github.com/efmsoft/logme
- Home
- Getting Started
- Why logme?
- Core Concepts
- Logging Macros
- Fatal Handling
- Crash Logging
- glog Compatibility
- C API
- Choosing Logging Macros
- Function tracing
- Trace Points
- Override Scopes
- Advanced Features
- Collapse Logging
- Feature Map
- Overview
- Console Backend
- Debugger Backend
- File Backend
- File Rotation & Retention
- Buffer Backend
- Ring Buffer Backend
- SharedFile Backend
- Callback Backend
- Windows Event Log Backend
- Custom Backends
- Runtime Control
- Configuration
- Configuration JSON
- Control Server
- Environment Control
- Control Policies
- Trace Points
- Message Filtering