Interface LogBuilder
-
public interface LogBuilderUsed to construct and emit logs from aLogEmitter.Obtain a
LogBuilderviaLogEmitter.logBuilder(), add properties using the setters, and emit the log by callingemit().This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidemit()Emit the log.LogBuildersetAttributes(io.opentelemetry.api.common.Attributes attributes)Set the attributes.LogBuildersetBody(String body)Set the body string.LogBuildersetContext(io.opentelemetry.context.Context context)Set the context.LogBuildersetEpoch(long timestamp, TimeUnit unit)Set the epoch timestamp using the timestamp and unit.LogBuildersetEpoch(Instant instant)Set the epoch timestamp using the instant.LogBuildersetName(String name)Set the name.LogBuildersetSeverity(Severity severity)Set the severity.LogBuildersetSeverityText(String severityText)Set the severity text.
-
-
-
Method Detail
-
setEpoch
LogBuilder setEpoch(long timestamp, TimeUnit unit)
Set the epoch timestamp using the timestamp and unit.
-
setEpoch
LogBuilder setEpoch(Instant instant)
Set the epoch timestamp using the instant.
-
setContext
LogBuilder setContext(io.opentelemetry.context.Context context)
Set the context.
-
setSeverity
LogBuilder setSeverity(Severity severity)
Set the severity.
-
setSeverityText
LogBuilder setSeverityText(String severityText)
Set the severity text.
-
setName
LogBuilder setName(String name)
Set the name.
-
setBody
LogBuilder setBody(String body)
Set the body string.
-
setAttributes
LogBuilder setAttributes(io.opentelemetry.api.common.Attributes attributes)
Set the attributes.
-
emit
void emit()
Emit the log.
-
-