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 by calling emit().

This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

  • Method Details

    • 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.
    • 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.