Class LogDataBuilder

java.lang.Object
io.opentelemetry.sdk.logs.data.LogDataBuilder

public final class LogDataBuilder extends Object
Builder for LogData.
  • Method Details

    • create

      public static LogDataBuilder create(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo)
      Returns a new LogDataBuilder with the default clock.
    • create

      public static LogDataBuilder create(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, io.opentelemetry.sdk.common.Clock clock)
      Returns a new LogDataBuilder.
    • setEpoch

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

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

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

      public LogDataBuilder setSeverity(Severity severity)
      Set the severity.
    • setSeverityText

      public LogDataBuilder setSeverityText(String severityText)
      Set the severity text.
    • setName

      public LogDataBuilder setName(String name)
      Set the name.
    • setBody

      public LogDataBuilder setBody(String body)
      Set the body string.
    • setAttributes

      public LogDataBuilder setAttributes(io.opentelemetry.api.common.Attributes attributes)
      Set the attributes.
    • build

      public LogData build()
      Build a LogData instance from the configured properties.