Class SimpleLogProcessor
- All Implemented Interfaces:
LogProcessor,Closeable,AutoCloseable
LogProcessor that passes LogData directly to the
configured exporter.
This processor will cause all logs to be exported directly as they finish, meaning each export
request will have a single log. Most backends will not perform well with a single log per request
so unless you know what you're doing, strongly consider using BatchLogProcessor instead,
including in special environments such as serverless runtimes. SimpleLogProcessor is
generally meant to for testing only.
-
Method Summary
Modifier and TypeMethodDescriptionstatic LogProcessorcreate(LogExporter exporter) Returns a newSimpleLogProcessorwhich exports logs to theLogExportersynchronously.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
-
create
Returns a newSimpleLogProcessorwhich exports logs to theLogExportersynchronously.This processor will cause all logs to be exported directly as they finish, meaning each export request will have a single log. Most backends will not perform well with a single log per request so unless you know what you're doing, strongly consider using
BatchLogProcessorinstead, including in special environments such as serverless runtimes.SimpleLogProcessoris generally meant to for testing only. -
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
-