Package io.opentelemetry.sdk.logs
Class SdkReadWriteLogRecord
- java.lang.Object
-
- io.opentelemetry.sdk.logs.SdkReadWriteLogRecord
-
- All Implemented Interfaces:
ReadWriteLogRecord
@ThreadSafe class SdkReadWriteLogRecord extends java.lang.Object implements ReadWriteLogRecord
-
-
Field Summary
Fields Modifier and Type Field Description private AttributesMapattributesprivate Value<?>bodyprivate InstrumentationScopeInfoinstrumentationScopeInfoprivate java.lang.Objectlockprivate LogLimitslogLimitsprivate longobservedTimestampEpochNanosprivate Resourceresourceprivate Severityseverityprivate java.lang.StringseverityTextprivate SpanContextspanContextprivate longtimestampEpochNanos
-
Constructor Summary
Constructors Modifier Constructor Description privateSdkReadWriteLogRecord(LogLimits logLimits, Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, long timestampEpochNanos, long observedTimestampEpochNanos, SpanContext spanContext, Severity severity, java.lang.String severityText, Value<?> body, AttributesMap attributes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static SdkReadWriteLogRecordcreate(LogLimits logLimits, Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, long timestampEpochNanos, long observedTimestampEpochNanos, SpanContext spanContext, Severity severity, java.lang.String severityText, Value<?> body, AttributesMap attributes)Create the log record with the given configuration.private AttributesgetImmutableAttributes()<T> ReadWriteLogRecordsetAttribute(AttributeKey<T> key, T value)Sets an attribute on the log record.LogRecordDatatoLogRecordData()Return an immutableLogRecordDatainstance representing this log record.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.opentelemetry.sdk.logs.ReadWriteLogRecord
setAllAttributes
-
-
-
-
Field Detail
-
logLimits
private final LogLimits logLimits
-
resource
private final Resource resource
-
instrumentationScopeInfo
private final InstrumentationScopeInfo instrumentationScopeInfo
-
timestampEpochNanos
private final long timestampEpochNanos
-
observedTimestampEpochNanos
private final long observedTimestampEpochNanos
-
spanContext
private final SpanContext spanContext
-
severity
private final Severity severity
-
severityText
@Nullable private final java.lang.String severityText
-
body
@Nullable private final Value<?> body
-
lock
private final java.lang.Object lock
-
attributes
@Nullable private AttributesMap attributes
-
-
Constructor Detail
-
SdkReadWriteLogRecord
private SdkReadWriteLogRecord(LogLimits logLimits, Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, long timestampEpochNanos, long observedTimestampEpochNanos, SpanContext spanContext, Severity severity, @Nullable java.lang.String severityText, @Nullable Value<?> body, @Nullable AttributesMap attributes)
-
-
Method Detail
-
create
static SdkReadWriteLogRecord create(LogLimits logLimits, Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, long timestampEpochNanos, long observedTimestampEpochNanos, SpanContext spanContext, Severity severity, @Nullable java.lang.String severityText, @Nullable Value<?> body, @Nullable AttributesMap attributes)
Create the log record with the given configuration.
-
setAttribute
public <T> ReadWriteLogRecord setAttribute(AttributeKey<T> key, T value)
Description copied from interface:ReadWriteLogRecordSets an attribute on the log record. If the log record previously contained a mapping for the key, the old value is replaced by the specified value.Note: the behavior of null values is undefined, and hence strongly discouraged.
- Specified by:
setAttributein interfaceReadWriteLogRecord
-
getImmutableAttributes
private Attributes getImmutableAttributes()
-
toLogRecordData
public LogRecordData toLogRecordData()
Description copied from interface:ReadWriteLogRecordReturn an immutableLogRecordDatainstance representing this log record.- Specified by:
toLogRecordDatain interfaceReadWriteLogRecord
-
-