Package io.opentelemetry.api.logs
Interface LogRecordBuilder
public interface LogRecordBuilder
Used to construct and emit log records from a
Logger.
Obtain a Logger.logRecordBuilder(), add properties using the setters, and emit the log
record by calling emit().
-
Method Summary
Modifier and TypeMethodDescriptionvoidemit()Emit the log record.default LogRecordBuildersetAllAttributes(io.opentelemetry.api.common.Attributes attributes) Sets attributes.<T> LogRecordBuildersetAttribute(io.opentelemetry.api.common.AttributeKey<T> key, T value) Sets an attribute.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. -
setAllAttributes
Sets attributes. If theLogRecordBuilderpreviously contained a mapping for any of the keys, the old values are replaced by the specified values. -
setAttribute
Sets an attribute. -
emit
void emit()Emit the log record.
-