Package io.opentelemetry.sdk.logs.export
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
ConstructorsModifierConstructorDescriptionprivate
MultiLogRecordExporter
(LogRecordExporter[] logRecordExporters) -
Method Summary
Modifier and TypeMethodDescription(package private) static LogRecordExporter
create
(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 registeredLogRecordExporter
s.shutdown()
Shutdown the log exporter.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.opentelemetry.sdk.logs.export.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:LogRecordExporter
Exports the collections of givenLogRecordData
.- Specified by:
export
in interfaceLogRecordExporter
- Parameters:
logs
- the collection ofLogRecordData
to be exported- Returns:
- the result of the export, which is often an asynchronous operation
-
flush
Flushes the data of all registeredLogRecordExporter
s.- Specified by:
flush
in interfaceLogRecordExporter
- Returns:
- the result of the operation
-
shutdown
Description copied from interface:LogRecordExporter
Shutdown the log exporter. Called whenSdkLoggerProvider.shutdown()
is called when this exporter is registered to the provider viaBatchLogRecordProcessor
orSimpleLogRecordProcessor
.- Specified by:
shutdown
in interfaceLogRecordExporter
- Returns:
- a
CompletableResultCode
which is completed when shutdown completes
-
toString
-