Package io.opentelemetry.sdk.logs.export
Interface LogRecordExporter
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
- All Known Implementing Classes:
MultiLogRecordExporter
,NoopLogRecordExporter
,OtlpGrpcLogRecordExporter
,OtlpHttpLogRecordExporter
public interface LogRecordExporter extends java.io.Closeable
An exporter is responsible for taking a collection ofLogRecordData
s and transmitting them to their ultimate destination.- Since:
- 1.27.0
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default 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(java.lang.Iterable<LogRecordExporter> exporters)
Returns aLogRecordExporter
which delegates all exports to theexporters
in order.CompletableResultCode
export(java.util.Collection<LogRecordData> logs)
Exports the collections of givenLogRecordData
.CompletableResultCode
flush()
Exports the collection ofLogRecordData
that have not yet been exported.CompletableResultCode
shutdown()
Shutdown the log exporter.
-
-
-
Method Detail
-
composite
static LogRecordExporter composite(LogRecordExporter... exporters)
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
static LogRecordExporter composite(java.lang.Iterable<LogRecordExporter> exporters)
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
CompletableResultCode export(java.util.Collection<LogRecordData> logs)
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 interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-