Package io.opentelemetry.sdk.logs
Interface LogBuilder
public interface LogBuilder
Used to construct and emit logs from a
LogEmitter.
Obtain a LogBuilder via LogEmitter.logBuilder(), add properties using the
setters, and emit the log to downstream LogProcessor(s) by calling emit().
-
Method Summary
Modifier and TypeMethodDescriptionvoidemit()Emit the log to downstreamLogProcessor(s).setAttributes(io.opentelemetry.api.common.Attributes attributes) Set the attributes.Set the body string.setContext(io.opentelemetry.context.Context context) Set the context.Set the epoch timestamp using the timestamp and unit.Set the epoch timestamp using the instant.setSeverity(Severity severity) Set the severity.setSeverityText(String severityText) Set the severity text.
-
Method Details
-
setEpoch
Set the epoch timestamp using the timestamp and unit. -
setEpoch
Set the epoch timestamp using the instant. -
setContext
Set the context. -
setSeverity
Set the severity. -
setSeverityText
Set the severity text. -
setBody
Set the body string. -
setAttributes
Set the attributes. -
emit
void emit()Emit the log to downstreamLogProcessor(s).
-