-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Scope
Processors are responsible for batching and conversion of LogRecords
to exportable representation and passing to exporters. LogRecordProcessors
can be registered directly on SDK LoggerProvider
and they are invoked in the same order as they were registered. Each processor registered on LoggerProvider
is part of a pipeline that consists of a processor and optional exporter. The SDK MUST allow each pipeline to end with an individual exporter:
+-----+------------------------+ +------------------------------+ +-------------------------+
| | | | | | |
| | | | Batching LogRecordProcessor | | LogRecordExporter |
| | +---> Simple LogRecordProcessor +---> (OtlpExporter) |
| | | | | | |
| SDK | Logger.emit(LogRecord) | +------------------------------+ +-------------------------+
| | |
| | |
| | |
| | |
| | |
+-----+------------------------+
For a LogRecordProcessor
registered directly on SDK LoggerProvider
, the logRecord
mutations MUST be visible in next registered processors.
OnEmit
OnEmit
is called when a LogRecord
is emitted. This method is called synchronously on the thread that emitted the LogRecord
, therefore it SHOULD NOT block or throw exceptions.