Class LogRecord

Inheritance Relationships

Derived Type

Class Documentation

class LogRecord

Maintains a representation of a log in a format that can be processed by a recorder.

This class is thread-compatible.

Subclassed by opentelemetry::sdk::logs::Recordable

Public Functions

virtual ~LogRecord() = default
virtual void SetTimestamp(common::SystemTimestamp timestamp) noexcept = 0

Set the timestamp for this log.

Parameters:

timestamp – the timestamp to set

virtual void SetObservedTimestamp(common::SystemTimestamp timestamp) noexcept = 0

Set the observed timestamp for this log.

Parameters:

timestamp – the timestamp to set

virtual void SetSeverity(logs::Severity severity) noexcept = 0

Set the severity for this log.

Parameters:

severity – the severity of the event

virtual void SetBody(const common::AttributeValue &message) noexcept = 0

Set body field for this log.

Parameters:

message – the body to set

virtual void SetAttribute(nostd::string_view key, const common::AttributeValue &value) noexcept = 0

Set an attribute of a log.

Parameters:
  • key – the name of the attribute

  • value – the attribute value

virtual void SetEventId(int64_t id, nostd::string_view name = {}) noexcept = 0

Set the Event Id.

Parameters:
  • id – The event id to set

  • name – Optional event name to set

virtual void SetTraceId(const trace::TraceId &trace_id) noexcept = 0

Set the trace id for this log.

Parameters:

trace_id – the trace id to set

virtual void SetSpanId(const trace::SpanId &span_id) noexcept = 0

Set the span id for this log.

Parameters:

span_id – the span id to set

virtual void SetTraceFlags(const trace::TraceFlags &trace_flags) noexcept = 0

Inject trace_flags for this log.

Parameters:

trace_flags – the trace flags to set