OpenTelemetry PHP

LateBindingLogger
in package
implements LoggerInterface

Table of Contents

Interfaces

LoggerInterface

Properties

$factory  : Closure
$logger  : LoggerInterface|null

Methods

__construct()  : mixed
emit()  : void
Deprecated, use {@link LoggerInterface::logRecordBuilder()} instead.
isEnabled()  : bool
Determine if the logger is enabled. Instrumentation authors SHOULD call this method each time they emit a LogRecord, to ensure they have the most up-to-date response.
logRecordBuilder()  : LogRecordBuilderInterface

Properties

Methods

emit()

Deprecated, use {@link LoggerInterface::logRecordBuilder()} instead.

public emit(LogRecord $logRecord) : void

Deprecated:

$logger->emit(new LogRecord()
    ->setTimestamp($timestamp)
    ...
    ->setEventName($eventName)
);

Instead, use:

$logger->logRecordBuilder()
    ->setTimestamp($timestamp)
    ...
    ->setEventName($eventName)
    ->emit();
Parameters
$logRecord : LogRecord
Attributes
#[Override]

isEnabled()

Determine if the logger is enabled. Instrumentation authors SHOULD call this method each time they emit a LogRecord, to ensure they have the most up-to-date response.

public isEnabled([ContextInterface|null $context = null ][, int|null $severityNumber = null ][, string|null $eventName = null ]) : bool
Parameters
$context : ContextInterface|null = null
$severityNumber : int|null = null
$eventName : string|null = null
Attributes
#[Override]
Return values
bool

        
On this page

Search results