Package io.opentelemetry.sdk.logs.data
Interface LogRecordData
@Immutable
public interface LogRecordData
Log definition as described in OpenTelemetry
Log Data Model.
- Since:
- 1.27.0
-
Method Summary
Modifier and TypeMethodDescriptionio.opentelemetry.api.common.AttributesReturns the attributes for this log, orAttributes.empty()if unset.getBody()Deprecated.default io.opentelemetry.api.common.Value<?>Returns theValuerepresentation of the log body, of null if unset.default StringReturns the event name, ornullif none is set.io.opentelemetry.sdk.common.InstrumentationScopeInfoReturns the instrumentation scope that generated this log.longReturns the timestamp at which the log record was observed, in epoch nanos.io.opentelemetry.sdk.resources.ResourceReturns the resource of this log.io.opentelemetry.api.logs.SeverityReturns the severity for this log, orSeverity.UNDEFINED_SEVERITY_NUMBERif unset.Returns the severity text for this log, or null if unset.io.opentelemetry.api.trace.SpanContextReturn the span context for this log, orSpanContext.getInvalid()if unset.longReturns the timestamp at which the log record occurred, in epoch nanos.intReturns 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. -
getTimestampEpochNanos
long getTimestampEpochNanos()Returns the timestamp at which the log record occurred, in epoch nanos. -
getObservedTimestampEpochNanos
long getObservedTimestampEpochNanos()Returns the timestamp at which the log record was observed, in epoch nanos. -
getSpanContext
io.opentelemetry.api.trace.SpanContext getSpanContext()Return the span context for this log, orSpanContext.getInvalid()if unset. -
getSeverity
io.opentelemetry.api.logs.Severity getSeverity()Returns the severity for this log, orSeverity.UNDEFINED_SEVERITY_NUMBERif unset. -
getSeverityText
Returns the severity text for this log, or null if unset. -
getBody
Deprecated.UsegetBodyValue()instead.Returns the body for this log, orBody.empty()if unset.If the body has been set to some
ValueTypeother thanValueType.STRING, this will return aBodywith a string representation of theValue. -
getBodyValue
Returns theValuerepresentation of the log body, of null if unset.- Since:
- 1.42.0
-
getAttributes
io.opentelemetry.api.common.Attributes getAttributes()Returns the attributes for this log, orAttributes.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(). -
getEventName
Returns the event name, ornullif none is set.- Since:
- 1.50.0
-
getBodyValue()instead.