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

        LogBuilder setSeverityText​(String severityText)
        Set the severity text.
      • setAttributes

        LogBuilder setAttributes​(io.opentelemetry.api.common.Attributes attributes)
        Set the attributes.
      • emit

        void emit()
        Emit the log.