-
Notifications
You must be signed in to change notification settings - Fork 3
Backend WindowsEventLog
WindowsEventLogBackend writes accepted log records to Windows Event Log.
It is intended for Windows services and deployments where operations teams inspect events through Event Viewer or central Windows event collection.
The backend type id is:
WindowsEventLogBackend
WindowsEventLogBackendConfig::Parse() supports these backend-specific fields:
| Field | Type | Default | Meaning |
|---|---|---|---|
source |
string | current executable base name | Windows Event Log source name |
event-id |
unsigned integer | 1000 |
Event id written with each record |
category |
unsigned integer, 0..65535 | 0 |
Event category |
Common backend fields from BackendConfig are also parsed, including async where supported.
Example:
{
"type": "WindowsEventLogBackend",
"source": "MyService",
"event-id": 1000,
"category": 0,
"async": true
}The backend maps logme levels to Windows event types:
-
ERRORandCRITICALbecome Windows error events -
WARNbecomes a Windows warning event - lower levels become informational events
The backend supports synchronous and asynchronous delivery.
In async mode, records are copied into a process-local Windows Event Log manager queue and drained by a manager thread. The manager is created when the first async event-log backend is used and is torn down after the last async event-log backend is removed.
During shutdown or fallback paths, the backend writes synchronously so records are not left stranded in the queue.
The backend is kept build-compatible on non-Windows platforms, but the actual Windows Event Log write path is a no-op there. Use this backend only when the target deployment has Windows Event Log.
include/Logme/Backend/WindowsEventLogBackend.hsource/Backend/WindowsEventLogBackend.cppsource/Backend/WindowsEventLogBackendConfig.cppinclude/Logme/WindowsEventLog/WindowsEventLogManager.hsource/WindowsEventLog/WindowsEventLogManager.cpp
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