Package io.opentelemetry.sdk.logs.export
Interface LogRecordExporter
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
MultiLogRecordExporter
,NoopLogRecordExporter
,OtlpGrpcLogRecordExporter
,OtlpHttpLogRecordExporter
An exporter is responsible for taking a collection of
LogRecordData
s and transmitting
them to their ultimate destination.- Since:
- 1.27.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
close()
Closes thisLogRecordExporter
, releasing any resources.static LogRecordExporter
composite
(LogRecordExporter... exporters) Returns aLogRecordExporter
which delegates all exports to theexporters
in order.static LogRecordExporter
composite
(Iterable<LogRecordExporter> exporters) Returns aLogRecordExporter
which delegates all exports to theexporters
in order.export
(Collection<LogRecordData> logs) Exports the collections of givenLogRecordData
.flush()
Exports the collection ofLogRecordData
that have not yet been exported.shutdown()
Shutdown the log exporter.
-
Method Details
-
composite
Returns aLogRecordExporter
which delegates all exports to theexporters
in order.Can be used to export to multiple backends using the same
LogRecordProcessor
like aSimpleLogRecordProcessor
or aBatchLogRecordProcessor
. -
composite
Returns aLogRecordExporter
which delegates all exports to theexporters
in order.Can be used to export to multiple backends using the same
LogRecordProcessor
like aSimpleLogRecordProcessor
or aBatchLogRecordProcessor
. -
export
Exports the collections of givenLogRecordData
.- Parameters:
logs
- the collection ofLogRecordData
to be exported- Returns:
- the result of the export, which is often an asynchronous operation
-
flush
CompletableResultCode flush()Exports the collection ofLogRecordData
that have not yet been exported.- Returns:
- the result of the flush, which is often an asynchronous operation
-
shutdown
CompletableResultCode shutdown()Shutdown the log exporter. Called whenSdkLoggerProvider.shutdown()
is called when this exporter is registered to the provider viaBatchLogRecordProcessor
orSimpleLogRecordProcessor
.- Returns:
- a
CompletableResultCode
which is completed when shutdown completes
-
close
default void close()Closes thisLogRecordExporter
, releasing any resources.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-