|
ORE Studio 0.0.4
|
Boost.Log sink backend that creates telemetry log_records. More...
#include <telemetry_sink_backend.hpp>
Inherits basic_sink_backend< boost::log::sinks::synchronized_feeding >.

Public Types | |
| using | log_record_handler = std::function< void(domain::log_record)> |
| Handler function type for processing log records. | |
Public Member Functions | |
| telemetry_sink_backend (std::shared_ptr< domain::resource > res, log_record_handler handler) | |
| Constructs the telemetry sink backend. | |
| void | consume (const boost::log::record_view &rec) |
| Processes a Boost.Log record and converts it to telemetry format. | |
Boost.Log sink backend that creates telemetry log_records.
This sink extracts trace context from log attributes and constructs OpenTelemetry-compatible log_records for export. It integrates with the existing Boost.Log infrastructure, receiving all log records and converting them to the telemetry domain model.
Usage:
| using log_record_handler = std::function<void(domain::log_record)> |
Handler function type for processing log records.
The handler is called for each log record after conversion to the telemetry domain model. Implementations may export to file, send to a collector, or perform any other processing.
|
explicit |
Constructs the telemetry sink backend.
| res | The resource describing the entity producing logs. Shared across all log records from this source. |
| handler | Function called for each converted log record. |
| void consume | ( | const boost::log::record_view & | rec | ) |
Processes a Boost.Log record and converts it to telemetry format.
This method is called by Boost.Log for each log record that passes the sink's filter. It extracts all relevant attributes, converts the severity level, and creates a domain::log_record with trace correlation if trace_id and span_id attributes are present.
| rec | The Boost.Log record view to process. |