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.CloseableAn exporter is responsible for taking a collection ofLogRecordDatas 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 voidclose()Closes thisLogRecordExporter, releasing any resources.static LogRecordExportercomposite(LogRecordExporter... exporters)Returns aLogRecordExporterwhich delegates all exports to theexportersin order.static LogRecordExportercomposite(java.lang.Iterable<LogRecordExporter> exporters)Returns aLogRecordExporterwhich delegates all exports to theexportersin order.CompletableResultCodeexport(java.util.Collection<LogRecordData> logs)Exports the collections of givenLogRecordData.CompletableResultCodeflush()Exports the collection ofLogRecordDatathat have not yet been exported.CompletableResultCodeshutdown()Shutdown the log exporter.
-
-
-
Method Detail
-
composite
static LogRecordExporter composite(LogRecordExporter... exporters)
Returns aLogRecordExporterwhich delegates all exports to theexportersin order.Can be used to export to multiple backends using the same
LogRecordProcessorlike aSimpleLogRecordProcessoror aBatchLogRecordProcessor.
-
composite
static LogRecordExporter composite(java.lang.Iterable<LogRecordExporter> exporters)
Returns aLogRecordExporterwhich delegates all exports to theexportersin order.Can be used to export to multiple backends using the same
LogRecordProcessorlike aSimpleLogRecordProcessoror aBatchLogRecordProcessor.
-
export
CompletableResultCode export(java.util.Collection<LogRecordData> logs)
Exports the collections of givenLogRecordData.- Parameters:
logs- the collection ofLogRecordDatato be exported- Returns:
- the result of the export, which is often an asynchronous operation
-
flush
CompletableResultCode flush()
Exports the collection ofLogRecordDatathat 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 viaBatchLogRecordProcessororSimpleLogRecordProcessor.- Returns:
- a
CompletableResultCodewhich is completed when shutdown completes
-
close
default void close()
Closes thisLogRecordExporter, releasing any resources.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-