loggerSharedState = new LoggerSharedState( $resource ?? ResourceInfoFactory::defaultResource(), (new LogRecordLimitsBuilder())->build(), $processor ); $this->instrumentationScopeFactory = $instrumentationScopeFactory; } /** * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/sdk.md#logger-creation */ public function getLogger(string $name, ?string $version = null, ?string $schemaUrl = null, iterable $attributes = []): LoggerInterface { if ($this->loggerSharedState->hasShutdown()) { return NoopLogger::getInstance(); } $scope = $this->instrumentationScopeFactory->create($name, $version, $schemaUrl, $attributes); return new Logger($this->loggerSharedState, $scope); } public function shutdown(CancellationInterface $cancellation = null): bool { return $this->loggerSharedState->shutdown($cancellation); } public function forceFlush(CancellationInterface $cancellation = null): bool { return $this->loggerSharedState->forceFlush($cancellation); } public static function builder(): LoggerProviderBuilder { return new LoggerProviderBuilder(); } }