class OpenTelemetryHandler extends AbstractHandler

Properties

protected ExceptionHandler|null $exceptionHandler

Methods

__construct(LoggerInterface $logger, OpenTelemetryManager $manager, ExceptionContextRegistry $exceptionContexts, Container $container, AttributeValidator $attributeValidator, int|string|Level $level = Level::Debug)

Create an OpenTelemetry log handler.

bool
isHandling(LogRecord $record)

Determine whether the record should be handled.

bool
handle(LogRecord $record)

Emit a Monolog record through the OpenTelemetry logger.

bool
isDirectlyRecorded(Throwable $exception)

Determine whether direct exception capture already emitted the record.

Details

at line 27
__construct(LoggerInterface $logger, OpenTelemetryManager $manager, ExceptionContextRegistry $exceptionContexts, Container $container, AttributeValidator $attributeValidator, int|string|Level $level = Level::Debug)

Create an OpenTelemetry log handler.

Parameters

LoggerInterface $logger
OpenTelemetryManager $manager
ExceptionContextRegistry $exceptionContexts
Container $container
AttributeValidator $attributeValidator
int|string|Level $level

at line 41
bool isHandling(LogRecord $record)

Determine whether the record should be handled.

Parameters

LogRecord $record

Return Value

bool

at line 49
bool handle(LogRecord $record)

Emit a Monolog record through the OpenTelemetry logger.

Parameters

LogRecord $record

Return Value

bool

at line 95
protected bool isDirectlyRecorded(Throwable $exception)

Determine whether direct exception capture already emitted the record.

Parameters

Throwable $exception

Return Value

bool