Class LogInput.Builder

java.lang.Object
codes.grow.packages.betterstack.logging.LogInput.Builder
Enclosing class:
LogInput

public static final class LogInput.Builder extends Object
Builder for LogInput.
  • Method Details

    • severity

      public LogInput.Builder severity(Severity severity)
      Sets the severity.
      Parameters:
      severity - severity
      Returns:
      this builder
    • attributes

      public LogInput.Builder attributes(Map<String,?> attributes)
      Replaces the attributes.
      Parameters:
      attributes - attributes (may be null)
      Returns:
      this builder
    • attribute

      public LogInput.Builder attribute(String key, Object value)
      Adds an attribute.
      Parameters:
      key - name
      value - attribute value
      Returns:
      this builder
    • timestamp

      public LogInput.Builder timestamp(Instant timestamp)
      Sets the event time.
      Parameters:
      timestamp - event time
      Returns:
      this builder
    • traceId

      public LogInput.Builder traceId(String traceId)
      Sets the trace id.
      Parameters:
      traceId - 32 hex characters
      Returns:
      this builder
    • spanId

      public LogInput.Builder spanId(String spanId)
      Sets the span id.
      Parameters:
      spanId - 16 hex characters
      Returns:
      this builder
    • build

      public LogInput build()
      Builds the input.
      Returns:
      the input