OpenTelemetry PHP

ReadableLogRecord extends LogRecord
in package

Tags
see
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#log-and-event-record-definition

"Note: Typically this will be implemented with a new interface or (immutable) value type."

Table of Contents

Constants

NANOS_PER_SECOND  = 1000000000

Properties

$attributes  : array<string|int, mixed>
$body  : mixed
$context  : ContextInterface|null
$convertedAttributes  : AttributesInterface
$observedTimestamp  : int|null
$severityNumber  : int
$severityText  : string|null
$spanContext  : SpanContextInterface
$timestamp  : int|null
$loggerSharedState  : LoggerSharedState
$scope  : InstrumentationScopeInterface

Methods

__construct()  : mixed
getAttributes()  : AttributesInterface
getBody()  : mixed|null
getContext()  : ContextInterface|null
getInstrumentationScope()  : InstrumentationScopeInterface
getObservedTimestamp()  : int|null
getResource()  : ResourceInfo
getSeverityNumber()  : int|null
getSeverityText()  : string|null
getSpanContext()  : SpanContextInterface|null
getTimestamp()  : int|null
setAttribute()  : self
setAttributes()  : self
setBody()  : self
setContext()  : self
setObservedTimestamp()  : self
setSeverityNumber()  : self
setSeverityText()  : self
setTimestamp()  : self

Constants

NANOS_PER_SECOND

public mixed NANOS_PER_SECOND = 1000000000

Properties

$attributes

protected array<string|int, mixed> $attributes = []

$observedTimestamp

protected int|null $observedTimestamp = null

$severityNumber

protected int $severityNumber = 0

$severityText

protected string|null $severityText = null

$timestamp

protected int|null $timestamp = null

Methods

getObservedTimestamp()

public getObservedTimestamp() : int|null
Return values
int|null

getSeverityNumber()

public getSeverityNumber() : int|null
Return values
int|null

getSeverityText()

public getSeverityText() : string|null
Return values
string|null

setAttribute()

public setAttribute(string $name, mixed $value) : self
Parameters
$name : string
$value : mixed
Return values
self

setBody()

public setBody([mixed $body = null ]) : self
Parameters
$body : mixed = null

The log record body

Return values
self

setObservedTimestamp()

public setObservedTimestamp([int|null $observedTimestamp = null ]) : self
Parameters
$observedTimestamp : int|null = null

Time, in nanoseconds since the unix epoch, when the event was observed by the collection system.

Return values
self

        
On this page

Search results