Interface LogRecordData


@Immutable public interface LogRecordData
Log definition as described in OpenTelemetry Log Data Model.
  • Method Summary

    Modifier and Type
    Method
    Description
    io.opentelemetry.api.common.Attributes
    Returns the attributes for this log, or Attributes.empty() if unset.
    Returns the body for this log, or Body.empty() if unset.
    long
    Returns the epoch timestamp in nanos when the log was recorded.
    io.opentelemetry.sdk.common.InstrumentationScopeInfo
    Returns the instrumentation scope that generated this log.
    io.opentelemetry.sdk.resources.Resource
    Returns the resource of this log.
    io.opentelemetry.api.logs.Severity
    Returns the severity for this log, or Severity.UNDEFINED_SEVERITY_NUMBER if unset.
    Returns the severity text for this log, or null if unset.
    io.opentelemetry.api.trace.SpanContext
    Return the span context for this log, or SpanContext.getInvalid() if unset.
    int
    Returns the total number of attributes that were recorded on this log.
  • Method Details

    • getResource

      io.opentelemetry.sdk.resources.Resource getResource()
      Returns the resource of this log.
    • getInstrumentationScopeInfo

      io.opentelemetry.sdk.common.InstrumentationScopeInfo getInstrumentationScopeInfo()
      Returns the instrumentation scope that generated this log.
    • getEpochNanos

      long getEpochNanos()
      Returns the epoch timestamp in nanos when the log was recorded.
    • getSpanContext

      io.opentelemetry.api.trace.SpanContext getSpanContext()
      Return the span context for this log, or SpanContext.getInvalid() if unset.
    • getSeverity

      io.opentelemetry.api.logs.Severity getSeverity()
      Returns the severity for this log, or Severity.UNDEFINED_SEVERITY_NUMBER if unset.
    • getSeverityText

      @Nullable String getSeverityText()
      Returns the severity text for this log, or null if unset.
    • getBody

      Body getBody()
      Returns the body for this log, or Body.empty() if unset.
    • getAttributes

      io.opentelemetry.api.common.Attributes getAttributes()
      Returns the attributes for this log, or Attributes.empty() if unset.
    • getTotalAttributeCount

      int getTotalAttributeCount()
      Returns the total number of attributes that were recorded on this log.

      This number may be larger than the number of attributes that are attached to this log, if the total number recorded was greater than the configured maximum value. See LogLimits.getMaxNumberOfAttributes().