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 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.
    • 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 to downstream LogProcessor(s).