Package io.opentelemetry.sdk.logs.export
Class BatchLogProcessor
java.lang.Object
io.opentelemetry.sdk.logs.export.BatchLogProcessor
- All Implemented Interfaces:
LogProcessor,Closeable,AutoCloseable
Implementation of the
LogProcessor that batches logs exported by the SDK then pushes them
to the exporter pipeline.
All logs reported by the SDK implementation are first added to a synchronized queue (with a
maxQueueSize maximum size, if queue is full logs are dropped). Logs are exported either
when there are maxExportBatchSize pending logs or scheduleDelayNanos has passed
since the last export finished.
-
Method Summary
Modifier and TypeMethodDescriptionstatic BatchLogProcessorBuilderbuilder(LogExporter logExporter) Returns a new Builder forBatchLogProcessor.voidEmit a log.io.opentelemetry.sdk.common.CompletableResultCodeProcess all logs that have not yet been processed.io.opentelemetry.sdk.common.CompletableResultCodeshutdown()Shutdown the log processor.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.opentelemetry.sdk.logs.LogProcessor
close
-
Method Details
-
builder
Returns a new Builder forBatchLogProcessor.- Parameters:
logExporter- theLogExporterto which the Logs are pushed- Returns:
- a new
BatchLogProcessorBuilder. - Throws:
NullPointerException- if thelogExporterisnull.
-
emit
Description copied from interface:LogProcessorEmit a log.- Specified by:
emitin interfaceLogProcessor- Parameters:
logData- the log
-
shutdown
public io.opentelemetry.sdk.common.CompletableResultCode shutdown()Description copied from interface:LogProcessorShutdown the log processor.- Specified by:
shutdownin interfaceLogProcessor- Returns:
- result
-
forceFlush
public io.opentelemetry.sdk.common.CompletableResultCode forceFlush()Description copied from interface:LogProcessorProcess all logs that have not yet been processed.- Specified by:
forceFlushin interfaceLogProcessor- Returns:
- result
-