Class MultiLogRecordExporter
java.lang.Object
io.opentelemetry.sdk.logs.export.MultiLogRecordExporter
- All Implemented Interfaces:
LogRecordExporter, Closeable, AutoCloseable
LogRecordExporter that forwards all received logs to a list of LogRecordExporter.
Can be used to export to multiple backends using the same LogRecordExporter like a
SimpleLogRecordProcessor or a BatchLogRecordProcessor.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateMultiLogRecordExporter(LogRecordExporter[] logRecordExporters) -
Method Summary
Modifier and TypeMethodDescription(package private) static LogRecordExportercreate(List<LogRecordExporter> logRecordExporters) Constructs and returns an instance of this class.export(Collection<LogRecordData> logs) Exports the collections of givenLogRecordData.flush()Flushes the data of all registeredLogRecordExporters.shutdown()Shutdown the log exporter.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface LogRecordExporter
close
-
Field Details
-
logger
-
logRecordExporters
-
-
Constructor Details
-
MultiLogRecordExporter
-
-
Method Details
-
create
Constructs and returns an instance of this class.- Parameters:
logRecordExporters- the exporters logs should be sent to- Returns:
- the aggregate log exporter
-
export
Description copied from interface:LogRecordExporterExports the collections of givenLogRecordData.- Specified by:
exportin interfaceLogRecordExporter- Parameters:
logs- the collection ofLogRecordDatato be exported- Returns:
- the result of the export, which is often an asynchronous operation
-
flush
Flushes the data of all registeredLogRecordExporters.- Specified by:
flushin interfaceLogRecordExporter- Returns:
- the result of the operation
-
shutdown
Description copied from interface:LogRecordExporterShutdown the log exporter. Called whenSdkLoggerProvider.shutdown()is called when this exporter is registered to the provider viaBatchLogRecordProcessororSimpleLogRecordProcessor.- Specified by:
shutdownin interfaceLogRecordExporter- Returns:
- a
CompletableResultCodewhich is completed when shutdown completes
-
toString
-