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 Details

    • setEpoch

      LogRecordBuilder setEpoch(long timestamp, TimeUnit unit)
      Set the epoch timestamp using the timestamp and unit.
    • setEpoch

      LogRecordBuilder setEpoch(Instant instant)
      Set the epoch timestamp using the instant.
    • setContext

      LogRecordBuilder setContext(io.opentelemetry.context.Context context)
      Set the context.
    • setSeverity

      LogRecordBuilder setSeverity(Severity severity)
      Set the severity.
    • setSeverityText

      LogRecordBuilder setSeverityText(String severityText)
      Set the severity text.
    • setBody

      LogRecordBuilder setBody(String body)
      Set the body string.
    • setAllAttributes

      default LogRecordBuilder setAllAttributes(io.opentelemetry.api.common.Attributes attributes)
      Sets attributes. If the LogRecordBuilder previously contained a mapping for any of the keys, the old values are replaced by the specified values.
    • setAttribute

      <T> LogRecordBuilder setAttribute(io.opentelemetry.api.common.AttributeKey<T> key, T value)
      Sets an attribute.
    • emit

      void emit()
      Emit the log record.